Skip to Content
CodeUI

Styles reference

@codeui/solid v0.3.0

Public style functions, variant attributes, and class namespaces.

PNG
styles-reference/part.tsx
import { badgeStyles } from "@codeui/solid/badge/parts";
export default function PartStyle() {
	return <span class={badgeStyles.root()} data-size="md" data-tone="neutral" data-variant="soft"><span class={badgeStyles.label()}>PNG</span></span>;
}

Part style functions return class-name strings, including an empty string for an unstyled part. They do not render elements or attach behavior, ARIA, state, or data-* attributes. The styled parts already apply these functions. Use the functions directly only when you also own the markup and its state attributes.

The reference below follows the exports in packages/kit/src/index.tsx and packages/kit/src/parts/.

Framework-neutral appearance helpers

Use @codeui/styles when you own the markup. A component entry exports an appearance helper for each part with variants. For example, badgeStyleProps({ tone: "info" }) returns the badge class, part marker, and variant attributes. Use dialogStyleProps.section({ variant: "well" }) for a dialog section, or call dialogStyleProps({ size: "settings", chrome: "inset" }) for its panel.

Spread the result in Solid or Svelte, or pass it to Vue's v-bind. In React, map class to className. For DOM elements, import applyStyleProps(element, props) from @codeui/styles. The behavior adapter owns interaction state and sets html[data-cui-input] to keyboard or pointer.

The published @codeui/styles/contract.json includes the options, allowed values, and emitted defaults in $appearance. Each declared default renders the same with its attribute omitted. Set data-cui-density on a container to set the density of its subtree. See the generated appearance reference for imports and part calls.

buttonStyles

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

button() returns the base class string. Set data-size, data-variant, or the data-ghost presence attribute on custom markup. buttonIcon and buttonText are class strings. buttonVars exposes the local CSS variables.

fieldStyles

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

baseFieldVariants() returns the base class. Set data-size and data-variant on the input. FieldSizes contains size names, baseFieldTheme is a class string, and baseFieldVars, inputHeight, and fontSize provide CSS variable references.

fieldErrorStyles

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

errorMessage is a class string for a field error. There are no callable recipes or variants.

fieldLabelStyles

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

label is a class string for a field label. There are no callable recipes or variants.

textFieldStyles

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

baseFieldContainer and textField are class strings. There are no callable recipes or variants.

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

content, subMenuContent, separator, item, and rightSlot are class strings. dropdownMenuThemeVars is a variable contract. There are no callable recipes or variants.

popoverStyles

Advanced raw namespace from @codeui/solid. These exports expose class names, variant helpers and CSS variable references.

The root namespace exports content() for the base classes. Use data-variant="bordered" for the bordered variant. The namespace also exposes the title and description classes and the popoverThemeVars variable contract.

styleFieldMessage

Advanced helper from @codeui/solid for use inside a vanilla-extract style definition. It accepts a complete map from each control size (xs, sm, md, lg) to a font size from xs through xl. It returns a style object with selectors, not a class string or a component. The selectors match ancestor data-field-size values and set the mapped font size.

Part style functions

Each section lists every function and the class source it returns. A source such as styles.root names the component's internal CSS export. Each helper returns a stable class string. Set the variant attributes described in the component page on your custom elements.

accordionStyles

Import from @codeui/solid/accordion/parts. Also exported from @codeui/solid.

FunctionReturns
root()styles.root
item()styles.item
header()styles.header
trigger()styles.trigger()
content()styles.content
icon()styles.icon
title()styles.title
summary()styles.summary
chevron()styles.chevron

Variant types: AccordionVariants = { density?: "default" | "compact" | "comfortable" }.

Set data-density on a custom trigger.

See Accordion for composition and state attributes.

alertStyles

Import from @codeui/solid/alert/parts.

FunctionReturns
root()styles.root()
icon()styles.icon
title()styles.title
description()styles.description
action()styles.action

Variant types: AlertTone = "neutral" | "info" | "success" | "warning" | "danger". AlertVariants = { tone?: AlertTone; fluid?: boolean }.

The Solid root defaults to tone neutral and fluid: false.

See Alert for composition and state attributes.

badgeStyles

Import from @codeui/solid/badge/parts.

FunctionReturns
root()styles.root()
icon()styles.icon
label()styles.label

Variant types: BadgeSize = "sm" | "md". BadgeTone = "neutral" | "info" | "success" | "warning" | "danger". BadgeVariant = "soft" | "outline". BadgeVariants = { size?: BadgeSize; tone?: BadgeTone; variant?: BadgeVariant }.

The Solid root defaults to size sm, tone neutral, and variant soft.

See Badge for composition and state attributes.

comboboxStyles

Import from @codeui/solid/combobox/parts. Also exported from @codeui/solid.

FunctionReturns
root()styles.root
control()styles.control()
input()styles.input
trigger()styles.trigger
icon()styles.icon
content()styles.content
arrow()styles.arrow
listbox()styles.listbox
item()styles.item
itemLabel()styles.itemLabel
itemDescription()styles.itemDescription
itemIndicator()styles.itemIndicator
section()styles.section
hiddenSelect()styles.hiddenSelect
label()styles.label
description()styles.description
errorMessage()styles.errorMessage

Variant types: ComboboxVariants = { size?: "sm" | "md" }.

See Combobox for composition and state attributes.

commandMenuStyles

Import from @codeui/solid/command-menu/parts. Also exported from @codeui/solid.

FunctionReturns
trigger()styles.trigger
overlay()styles.overlay
content()styles.content
title()styles.title
search()styles.search
searchInput()styles.searchInput
hint()styles.hint
listbox()styles.listbox
group()styles.group
groupLabel()styles.groupLabel
item()styles.item
leading()styles.leading
itemLabel()styles.itemLabel
itemDescription()styles.itemDescription
itemIndicator()styles.itemIndicator
shortcut()styles.shortcut
empty()styles.empty

No variant arguments.

See Command menu for composition and state attributes.

dialogStyles

Import from @codeui/solid/dialog/parts.

FunctionReturns
trigger()""
overlay()styles.overlay
positioner()styles.positioner
panel()styles.panel()
header()styles.title
title()""
description()styles.description
closeButton()""
body()styles.panelContent
footer()styles.panelFooter

Variant types: DialogSize = "auto" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | "settings" | "export".

Set data-size and data-chrome on a custom panel.

See Dialog for composition and state attributes.

kbdStyles

Import from @codeui/solid/kbd/parts.

FunctionReturns
root()styles.root()

Variant types: KbdSize = "sm" | "md". KbdVariant = "keycap" | "hint". KbdVariants = { size?: KbdSize; variant?: KbdVariant }.

The Solid root defaults to size sm and variant keycap.

See Kbd for composition and state attributes.

optionCardStyles

Import from @codeui/solid/option-card/parts. Also exported from @codeui/solid.

FunctionReturns
root()styles.root
label()styles.label
description()styles.description
errorMessage()styles.errorMessage
item()styles.item
itemInput()styles.itemInput
itemControl()styles.itemControl
itemIndicator()styles.itemIndicator
itemLabel()styles.itemLabel
itemDescription()styles.itemDescription
preview()styles.preview
badge()styles.badge

Variant types: OptionCardVariant = "card" | "tile". OptionCardVariants = { variant?: OptionCardVariant }.

The Solid components set the variant attributes.

See Option card for composition and state attributes.

popoverStyles

Import from @codeui/solid/popover/parts.

FunctionReturns
trigger()""
anchor()""
content()styles.content()
arrow()""
title()styles.title
description()styles.description
closeButton()""

Variant types: PopoverVariant = "default" | "bordered".

Set data-variant="bordered" on custom content.

See Popover for composition and state attributes.

progressStyles

Import from @codeui/solid/progress/parts. Also exported from @codeui/solid.

FunctionReturns
root()styles.root
label()styles.label
track()styles.track
fill()styles.fill
valueLabel()styles.valueLabel

Variant types: ProgressVariants = { size?: "sm" | "md" }.

The Solid components set the variant attributes.

See Progress for composition and state attributes.

sheetStyles

Import from @codeui/solid/sheet/parts.

FunctionReturns
trigger()""
overlay()styles.overlay
content()styles.content()
header()styles.header
title()styles.title
description()styles.description
closeButton()styles.closeButton
handle()styles.handle
body()styles.body
footer()styles.footer

Variant types: SheetSide = "bottom" | "left" | "right".

Set data-side on custom content. The Solid Content part defaults to bottom.

See Sheet for composition and state attributes.

skeletonStyles

Import from @codeui/solid/skeleton/parts.

FunctionReturns
root()styles.root()

Variant types: SkeletonVariants = { circle?: boolean; animate?: boolean }.

The Solid root defaults to animate: true.

See Skeleton for composition and state attributes.

sliderStyles

Import from @codeui/solid/slider/parts. Also exported from @codeui/solid.

FunctionReturns
root()styles.root
label()styles.label
description()styles.description
errorMessage()styles.errorMessage
track()styles.track
fill()styles.fill
thumb()styles.thumb
input()styles.input
valueLabel()styles.valueLabel

Variant types: SliderVariants = { orientation?: "horizontal" | "vertical" }.

The Solid components set the variant attributes.

See Slider for composition and state attributes.

spinnerStyles

Import from @codeui/solid/spinner/parts.

FunctionReturns
root()styles.root()
track()styles.track
indicator()styles.indicator

Variant types: SpinnerSize = "sm" | "md" | "lg". SpinnerVariants = { size?: SpinnerSize }.

The Solid root defaults to size md.

See Spinner for composition and state attributes.

stackStyles

Import from @codeui/solid/stack/parts.

FunctionReturns
root()root

The Gap values are 0, 0.5, 1, 1.5, 2, 3, 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 56, 64, and px.

Variant types: StackVariants = { gap?: Gap; align?: "start" | "center" | "end" | "stretch" | "baseline"; justify?: "start" | "center" | "end" | "between" | "around" | "evenly"; direction?: "row" | "column"; wrap?: boolean; }.

The Solid components set the variant attributes.

See Stack for composition and state attributes.

switchStyles

Import from @codeui/solid/switch/parts. Also exported from @codeui/solid.

FunctionReturns
root()styles.root
input()styles.input
control()styles.control
thumb()styles.thumb
label()styles.label
description()styles.description
errorMessage()styles.errorMessage

Variant types: SwitchVariants = { size?: "sm" | "md" }.

The Solid components set the variant attributes.

See Switch for composition and state attributes.

textStyles

Import from @codeui/solid/text/parts.

FunctionReturns
root()root

Variant types: TextVariants = { size?: keyof typeof tokens.font.size; weight?: keyof typeof tokens.font.weight; tone?: "default" | "muted" | "hint" | "label" | "danger" | "success"; }.

The Solid components set the variant attributes.

See Text for composition and state attributes.

toastStyles

Import from @codeui/solid/toast/parts.

FunctionReturns
region()styles.region()
list()styles.list
root()styles.root()
title()styles.title
description()styles.description
closeButton()styles.closeButton
progressTrack()styles.progressTrack
progressFill()styles.progressFill
icon()styles.icon
action()styles.action

Variant types: ToastTone = "neutral" | "info" | "success" | "warning" | "danger". ToastPosition = | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right". ToastVariants = { tone?: ToastTone; position?: ToastPosition }.

See Toast for composition and state attributes.

On this page