Package-level declarations

Types

Link copied to clipboard
enum Layer : Enum<Layer>

Layering tokens are explicit tokens used to manually map the layering model onto components. Layering tokens come in predefined sets that coordinate with the different layer levels. For each layer that a component needs to lives on, a separate component variation must be built using the tokens from that layer set.

Link copied to clipboard
data class Theme(val background: Color, val backgroundActive: Color, val backgroundBrand: Color, val backgroundHover: Color, val backgroundInverse: Color, val backgroundInverseHover: Color, val backgroundSelected: Color, val backgroundSelectedHover: Color, val borderDisabled: Color, val borderInteractive: Color, val borderInverse: Color, val borderStrong01: Color, val borderStrong02: Color, val borderStrong03: Color, val borderSubtle00: Color, val borderSubtle01: Color, val borderSubtle02: Color, val borderSubtle03: Color, val borderSubtleSelected01: Color, val borderSubtleSelected02: Color, val borderSubtleSelected03: Color, val borderTile01: Color, val borderTile02: Color, val borderTile03: Color, val field01: Color, val field02: Color, val field03: Color, val fieldHover01: Color, val fieldHover02: Color, val fieldHover03: Color, val focus: Color, val focusInset: Color, val focusInverse: Color, val highlight: Color, val iconDisabled: Color, val iconInteractive: Color, val iconInverse: Color, val iconOnColor: Color, val iconOnColorDisabled: Color, val iconPrimary: Color, val iconSecondary: Color, val interactive: Color, val layer01: Color, val layer02: Color, val layer03: Color, val layerAccent01: Color, val layerAccent02: Color, val layerAccent03: Color, val layerAccentActive01: Color, val layerAccentActive02: Color, val layerAccentActive03: Color, val layerAccentHover01: Color, val layerAccentHover02: Color, val layerAccentHover03: Color, val layerActive01: Color, val layerActive02: Color, val layerActive03: Color, val layerHover01: Color, val layerHover02: Color, val layerHover03: Color, val layerSelected01: Color, val layerSelected02: Color, val layerSelected03: Color, val layerSelectedDisabled: Color, val layerSelectedHover01: Color, val layerSelectedHover02: Color, val layerSelectedHover03: Color, val layerSelectedInverse: Color, val linkInverse: Color, val linkInverseActive: Color, val linkInverseHover: Color, val linkInverseVisited: Color, val linkPrimary: Color, val linkPrimaryHover: Color, val linkSecondary: Color, val linkVisited: Color, val overlay: Color, val shadow: Color, val skeletonBackground: Color, val skeletonElement: Color, val supportCautionMajor: Color, val supportCautionMinor: Color, val supportCautionUndefined: Color, val supportError: Color, val supportErrorInverse: Color, val supportInfo: Color, val supportInfoInverse: Color, val supportSuccess: Color, val supportSuccessInverse: Color, val supportWarning: Color, val supportWarningInverse: Color, val textDisabled: Color, val textError: Color, val textHelper: Color, val textInverse: Color, val textOnColor: Color, val textOnColorDisabled: Color, val textPlaceholder: Color, val textPrimary: Color, val textSecondary: Color, val toggleOff: Color, val aiColors: AiColors, val buttonColors: ButtonColors, val chatColors: ChatColors, val notificationColors: NotificationColors, val tagColors: TagColors)

Themes are used to modify existing components to fit a specific visual style. By using Carbon’s tokens, developers can easily customize all of their components by changing a set of universal variables, eliminating the need to modify individual components.

Properties

Link copied to clipboard

One of the default light themes available in Carbon.

Link copied to clipboard

One of the default light themes available in Carbon.

Link copied to clipboard

One of the default dark themes available in Carbon.

Link copied to clipboard

A staticCompositionLocalOf that provides a Carbon inline Theme, usually used for components that need to be themed differently from the rest of the app, such as UI Shell components.

Link copied to clipboard

A staticCompositionLocalOf that provides a Layer token. Layering tokens are explicit tokens used to manually map the layering model onto components.

Link copied to clipboard
Link copied to clipboard

One of the default light themes available in Carbon.

Functions

Link copied to clipboard
fun Theme.borderStrongColor(layer: Layer = Layer.Layer00): Color

Returns the contextual border-strong color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.borderSubtleColor(layer: Layer = Layer.Layer00): Color

Returns the contextual border-subtle color token corresponding to the layer it is placed on.

Link copied to clipboard
fun CarbonLayer(content: @Composable () -> Unit)

Automatically provides an upper layer to the composition, based on the current layer.

fun CarbonLayer(layer: Layer, content: @Composable () -> Unit)

Provides a Layer to following composition.

Link copied to clipboard

Applies a background color to the modifier based on the current Layer.

Link copied to clipboard
fun Theme.containerColor(layer: Layer = Layer.Layer00): Color

Returns the container color based on a provided layer.

Link copied to clipboard
fun Theme.fieldColor(layer: Layer = Layer.Layer00): Color

Returns the contextual field color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerAccentActiveColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-accent-active color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerAccentColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-accent color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerAccentHoverColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-accent-hover color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerActiveColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-active color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerHoverColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-hover color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerSelectedColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-selected color token corresponding to the layer it is placed on.

Link copied to clipboard
fun Theme.layerSelectedHoverColor(layer: Layer = Layer.Layer00): Color

Returns the contextual layer-selected-hover color token corresponding to the layer it is placed on.