Search code examples
javascriptreact-nativereact-native-ui-kitten

Is there a way to set the primary color as the background color to the Layout component using UI Kitten?


I'm building a login screen using UI Kitten 4.0, and I want to set a background color to the Layout component to be the primary color of the current theme.

There isn't any reference on the documentation about this as it is on the Button component API page.

I would like to achieve something like the code below.

import React, { Component } from "react"
import { Layout, Text } from "react-native-ui-kitten"

export default class Login extends Component {
    render() {
        return (
          <Layout primary>
            <Text>Log in</Text>
          </Layout>
        )
    }
}

Solution

  • We also have built-in API to access theme properties. Check the Snack