githubEdit

🎬The ValenceProvider

Last updated: 2.6.0 (09/06/2024)

The ValenceProvider provides every component in your app with the relevant styling and default values that they require to function correctly.

Within the root app file (usually App.tsx or App.jsx), import and add the ValenceProvider:

App.tsx
import { ValenceProvider } from "@valence-ui/core"

function App() {
  return ( 
    <>
      <ValenceProvider>
        {/* Your app here */}
      </ValenceProvider>
    </>
  )
}

export default App;

Modifying default attributes

Every value that the ValenceProvider supplies to your app can be modified by passing in props to the component:

App.tsx
import { ValenceProvider } from "@valence-ui/core"

function App() {
  return ( 
    <>
      <ValenceProvider
        breakpoints={{
          mobileWidth: 480,
          tabletWidth: 768,
          desktopLargeWidth: 1024,
          tvWidth: 1440,
        }}
      >
        {/* Your app here */}
      </ValenceProvider>
    </>
  )
}

export default App;

Props

chevron-rightcolorshashtag

Type:

Color[]

Default value:

DEFAULT_PALETTE

Description:

A list of all colors to use.

chevron-rightprimaryColorhashtag

Type:

string

Default value:

"pink"

Description:

The primary color to default upon.

chevron-rightpreferredColorSchemehashtag

Type:

PreferrableColorScheme ("light" | "dark" | "system")

Default value:

"system"

Description:

The user's preferred color scheme.

chevron-rightdefaultshashtag

Type:

Default value:

Description:

Default sizes and parameters for common attributes.

chevron-rightfontFamilyhashtag

Type:

Default value:

Description:

The default font families to use in specific contexts.

chevron-rightgetFont()hashtag

Type:

Description:

Finds a font family within the theme context.

chevron-rightsizeClasseshashtag

Type:

Default value:

Description:

Standardised sizing guide to use for components.

chevron-rightgetSize()hashtag

Type:

Description:

Finds a size within the theme context.

chevron-righttitleshashtag

Type:

Default value:

Description:

Props to refer to for titles.

chevron-rightbreakpointshashtag

Type:

Default value:

Description:

Breakpoints to use for determining breakpoint-sensitive props.

Last updated