Style props
Use component props for layout, color, typography, borders, and visual states.
Use props
Whisk/UI utility props compile to static CSS classes. Use them when a component exposes the visual rule you need.
Props keep layout and token choices beside the component they affect. Use semantic components for behavior, then apply utility props for layout, spacing, color, typography, and surfaces.
The packaged stylesheet covers the default component profile and common Box utilities, including spacing. Configure the build plugin when your application uses utility values outside that profile, recipes, or runtime choices declared through utilityUses.
A utility value must be a literal. For a value chosen at runtime, use a named recipe or declare its possible values in utilityUses.
Runtime values
The build must know every utility class it needs to emit before the application runs.
import { Box } from "@smoothie-framework/whisk-react";
export function AccountCard(props: { isActive: boolean; isCompact: boolean }) {
return (
<Box
padding={props.isCompact ? 2 : 4}
background={props.isActive ? "accent" : "surface2"}
/>
);
}The build stops with WhiskUtilityScanError: the computed utility prop must be a literal value or have its possible values declared in utilityUses.
import type { CompileWhiskCssOptions } from "@smoothie-framework/whisk-styles";
export const styleOptions = {
utilitySources: ["src"],
utilityUses: [
{ name: "padding", value: 2 },
{ name: "padding", value: 4 },
{ name: "background", value: "accent" },
{ name: "background", value: "surface2" },
],
} satisfies CompileWhiskCssOptions;import { defineConfig } from "vite";
import { whiskStyles } from "@smoothie-framework/whisk-styles/vite";
import { styleOptions } from "./styles.config.js";
export default defineConfig({
plugins: [whiskStyles(styleOptions)],
});With that configuration, the AccountCard example is supported. You choose the filename; pass its exported options to the build plugin explicitly. Keep the list finite and close to the application configuration. For an application-owned pattern with variants, use a recipe instead; see the recipe build setup.
Prop reference
This is the complete generic utility surface. A component exposes only the utility props in its own documented props.
The foundation pages explain the token scales and semantic roles used by these props: Spacing, Sizes, Colors, Borders and radii, and Typography.
Spacing
Padding: all sides
All padding props accept Responsive<SpacingStep>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
padding | p | padding | Spacing |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box padding={4} />
// Shorthand
<Box p={4} />Padding: axis
All padding props accept Responsive<SpacingStep>.
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box paddingX={4} />
// Shorthand
<Box px={4} />Padding: one side
All padding props accept Responsive<SpacingStep>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
paddingTop | pt | padding-top | Spacing |
paddingRight | pr | padding-right | Spacing |
paddingBottom | pb | padding-bottom | Spacing |
paddingLeft | pl | padding-left | Spacing |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box paddingTop={4} />
// Shorthand
<Box pt={4} />Padding: logical
All padding props accept Responsive<SpacingStep>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
paddingStart | ps | padding-inline-start | Spacing |
paddingEnd | pe | padding-inline-end | Spacing |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box paddingStart={4} />
// Shorthand
<Box ps={4} />Margin: all sides
Margin props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
margin | m | margin | Spacing |
margin and m also accept one responsive { x?, y? } object to set both axes.
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box margin={"auto"} />
// Shorthand
<Box m={"auto"} />Margin: axis
Margin props accept Responsive<UtilityValue>.
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box marginX={"auto"} />
// Shorthand
<Box mx={"auto"} />Margin: one side
Margin props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
marginTop | mt | margin-top | Spacing |
marginRight | mr | margin-right | Spacing |
marginBottom | mb | margin-bottom | Spacing |
marginLeft | ml | margin-left | Spacing |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box marginTop={4} />
// Shorthand
<Box mt={4} />Margin: logical
Margin props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
marginStart | ms | margin-inline-start | Spacing |
marginEnd | me | margin-inline-end | Spacing |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box marginStart={4} />
// Shorthand
<Box ms={4} />Gap and sibling space
Gap and sibling-space props accept Responsive<SpacingStep>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
gap | — | gap | Spacing |
gapX | — | column-gap | Spacing |
gapY | — | row-gap | Spacing |
spaceX | — | margin-inline-start | Spacing |
spaceY | — | margin-block-start | Spacing |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box gap={4} />
// Exact prop
// No shorthand is defined for this prop.Layout and sizing
Display and box sizing
These props accept Responsive<UtilityValue>, except inline, which accepts Responsive<boolean>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
display | — | display | — |
inline | — | display | — |
boxSizing | — | box-sizing | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box display={"flex"} />
// Exact prop
// No shorthand is defined for this prop.Position and offsets
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
position | — | position | — |
top | — | top | — |
right | — | right | — |
bottom | — | bottom | — |
left | — | left | — |
inset | — | inset | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box position={"relative"} />
// Exact prop
// No shorthand is defined for this prop.Overflow and isolation
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
overflow | — | overflow | — |
overflowX | — | overflow-x | — |
overflowY | — | overflow-y | — |
isolation | — | isolation | — |
aspectRatio | — | aspect-ratio | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box overflow={"hidden"} />
// Exact prop
// No shorthand is defined for this prop.Dimensions
Dimension props accept Responsive<DimensionValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
width | w | width | Sizes |
height | h | height | Sizes |
minWidth | minW | min-width | Sizes |
maxWidth | maxW | max-width | Sizes |
minHeight | minH | min-height | Sizes |
maxHeight | maxH | max-height | Sizes |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box width={"full"} />
// Shorthand
<Box w={"full"} />Flex item sizing
basis and shrink accept Responsive<UtilityValue>; grow accepts Responsive<UtilityValue | boolean>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
basis | — | flex-basis | Sizes |
grow | — | flex-grow | — |
shrink | — | flex-shrink | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box grow={true} />
// Exact prop
// No shorthand is defined for this prop.Flex and grid
Flex axis
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
direction | — | flex-direction | — |
wrap | — | flex-wrap | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box direction={"row"} />
// Exact prop
// No shorthand is defined for this prop.Flex alignment
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
align | — | align-items | — |
alignItems | — | align-items | — |
alignContent | — | align-content | — |
alignSelf | — | align-self | — |
justify | — | justify-content | — |
justifyContent | — | justify-content | — |
justifyItems | — | justify-items | — |
justifySelf | — | justify-self | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box justify={"between"} />
// Exact prop
// No shorthand is defined for this prop.Grid alignment
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
placeContent | — | place-content | — |
placeItems | — | place-items | — |
placeSelf | — | place-self | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box placeItems={"center"} />
// Exact prop
// No shorthand is defined for this prop.Grid templates
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
columns | cols | grid-template-columns | — |
rows | — | grid-template-rows | — |
areas | — | grid-template-areas | — |
area | — | grid-area | — |
autoColumns | — | grid-auto-columns | — |
autoRows | — | grid-auto-rows | — |
flow | — | grid-auto-flow | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box columns={3} />
// Shorthand
<Box cols={3} />Grid placement
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
colSpan | — | grid-column | — |
colStart | — | grid-column-start | — |
colEnd | — | grid-column-end | — |
rowSpan | — | grid-row | — |
rowStart | — | grid-row-start | — |
rowEnd | — | grid-row-end | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box colSpan={2} />
// Exact prop
// No shorthand is defined for this prop.Color, border, radius, and elevation
Surface and text colors
These props accept Responsive<UtilityValue>.
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box background={"surface2"} />
// Shorthand
<Box bg={"surface2"} />Border shorthand
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
border | — | border | Borders |
borderTop | — | border-top | Borders |
borderBottom | — | border-bottom | Borders |
borderLeft | — | border-left | Borders |
borderRight | — | border-right | Borders |
borderStart | — | border-inline-start | Borders |
borderEnd | — | border-inline-end | Borders |
borderX | — | border-inline | Borders |
borderY | — | border-block | Borders |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box border={"sm"} />
// Exact prop
// No shorthand is defined for this prop.Border and outline colors
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
borderColor | — | border-color | Colors |
outlineColor | — | outline-color | Colors |
borderTopColor | — | border-top-color | Colors |
borderBottomColor | — | border-bottom-color | Colors |
borderLeftColor | — | border-left-color | Colors |
borderRightColor | — | border-right-color | Colors |
borderStartColor | — | border-inline-start-color | Colors |
borderEndColor | — | border-inline-end-color | Colors |
borderXColor | — | border-inline-color | Colors |
borderYColor | — | border-block-color | Colors |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box borderColor={"borderSubtle"} />
// Exact prop
// No shorthand is defined for this prop.Border widths
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
borderWidth | — | border-width | Borders |
borderTopWidth | — | border-top-width | Borders |
borderBottomWidth | — | border-bottom-width | Borders |
borderLeftWidth | — | border-left-width | Borders |
borderRightWidth | — | border-right-width | Borders |
borderStartWidth | — | border-inline-start-width | Borders |
borderEndWidth | — | border-inline-end-width | Borders |
borderXWidth | — | border-inline-width | Borders |
borderYWidth | — | border-block-width | Borders |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box borderWidth={"sm"} />
// Exact prop
// No shorthand is defined for this prop.Border styles
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
borderStyle | — | border-style | — |
borderTopStyle | — | border-top-style | — |
borderBottomStyle | — | border-bottom-style | — |
borderLeftStyle | — | border-left-style | — |
borderRightStyle | — | border-right-style | — |
borderStartStyle | — | border-inline-start-style | — |
borderEndStyle | — | border-inline-end-style | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box borderStyle={"solid"} />
// Exact prop
// No shorthand is defined for this prop.Sibling dividers
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
divideX | — | border-inline-start-width | Borders |
divideY | — | border-top-width | Borders |
divideColor | — | border-color | Colors |
divideStyle | — | border-style | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box divideY={"sm"} />
// Exact prop
// No shorthand is defined for this prop.Radii: all and sides
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
borderRadius | rounded | border-radius | Radii |
borderTopRadius | roundedTop | border-top-left-radius; border-top-right-radius | Radii |
borderBottomRadius | roundedBottom | border-bottom-left-radius; border-bottom-right-radius | Radii |
borderLeftRadius | roundedLeft | border-top-left-radius; border-bottom-left-radius | Radii |
borderRightRadius | roundedRight | border-top-right-radius; border-bottom-right-radius | Radii |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box borderRadius={"lg"} />
// Shorthand
<Box rounded={"lg"} />Radii: physical corners
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
borderTopLeftRadius | roundedTopLeft | border-top-left-radius | Radii |
borderTopRightRadius | roundedTopRight | border-top-right-radius | Radii |
borderBottomLeftRadius | roundedBottomLeft | border-bottom-left-radius | Radii |
borderBottomRightRadius | roundedBottomRight | border-bottom-right-radius | Radii |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box borderTopLeftRadius={"lg"} />
// Shorthand
<Box roundedTopLeft={"lg"} />Radii: logical corners
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
borderInlineStartRadius | roundedStart | border-start-start-radius; border-end-start-radius | Radii |
borderInlineEndRadius | roundedEnd | border-start-end-radius; border-end-end-radius | Radii |
borderStartStartRadius | roundedStartStart | border-start-start-radius | Radii |
borderStartEndRadius | roundedStartEnd | border-start-end-radius | Radii |
borderEndStartRadius | roundedEndStart | border-end-start-radius | Radii |
borderEndEndRadius | roundedEndEnd | border-end-end-radius | Radii |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box borderStartStartRadius={"lg"} />
// Shorthand
<Box roundedStartStart={"lg"} />Elevation and layers
These props accept Responsive<UtilityValue>.
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box boxShadow={"md"} />
// Shorthand
<Box shadow={"md"} />Typography, transforms, and visibility
Text style and alignment
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
textAlign | — | text-align | — |
textStyle | — | font-family; font-size; font-weight; line-height; letter-spacing | Typography |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box textStyle={"body"} />
// Exact prop
// No shorthand is defined for this prop.Text presentation
textTransform and textDecoration accept their documented Responsive token unions.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
textTransform | — | text-transform | — |
textDecoration | textDecor | text-decoration | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box textDecoration={"underline"} />
// Shorthand
<Box textDecor={"underline"} />Text overflow
uppercase and truncate accept Responsive<boolean>; maxLines accepts Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
uppercase | — | text-transform | — |
truncate | — | overflow; text-overflow; white-space | — |
maxLines | — | display; -webkit-line-clamp; -webkit-box-orient; overflow | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box truncate={true} />
// Exact prop
// No shorthand is defined for this prop.Translation and cursor
These props accept Responsive<UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
translateX | — | translate | Spacing |
translateY | — | translate | Spacing |
cursor | — | cursor | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box translateX={2} />
// Exact prop
// No shorthand is defined for this prop.Responsive visibility
hideFrom and hideBelow accept a BreakpointKey.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
hideFrom | — | display | Breakpoints |
hideBelow | — | display | Breakpoints |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box hideBelow={"md"} />
// Exact prop
// No shorthand is defined for this prop.Interaction states
Each pseudo prop accepts a static Record<string, UtilityValue>.
| Prop | Shorthand | CSS property | Token scale |
|---|---|---|---|
_hover | — | — | — |
_focus | — | — | — |
_active | — | — | — |
import { Box } from "@smoothie-framework/whisk-react";
// Long form
<Box _hover={{{ background: "surface3" }}} />
// Exact prop
// No shorthand is defined for this prop.Surface example
Use a semantic surface, then make the layout and presentation choices explicit.
Account summary
Your saved details are ready to review.
import { Box, Text } from "@smoothie-framework/whisk-react";
export function AccountSummary() {
return (
<Box
padding={4}
background="surface2"
border="sm"
borderColor="borderSubtle"
rounded="lg"
shadow="sm"
>
<Text textStyle="label">Account summary</Text>
<Text textStyle="body" color="subtle">
Your saved details are ready to review.
</Text>
</Box>
);
}