Skip to content
Browse documentation
whisk/ui

Layer styles

Reuse a surface treatment made from background, border, radius, shadow, and opacity tokens.

Layer anatomy

A layer style is a repeatable surface treatment assembled from foundation tokens.

Compose a layer from its background, border, radius, shadow, and—where the design needs it—opacity. Choose semantic tokens so the treatment remains meaningful across themes.

Whisk/UI does not provide a single layerStyle prop. Apply a one-off treatment with utility props; create a recipe when the same treatment is reused.

Layer usage

Keep the token choices explicit for one surface; name them in a recipe when the pattern repeats.

Activity

3 deployments completed today.

import { Box, Text } from "@smoothie-framework/whisk-react";

export function ActivityCard() {
  return (
    <Box
      background="surface2"
      border="sm"
      borderColor="borderSubtle"
      rounded="lg"
      shadow="sm"
      padding={4}
    >
      <Text textStyle="caption">Activity</Text>
      <Text textStyle="body" color="subtle">3 deployments completed today.</Text>
    </Box>
  );
}

For a named application pattern used in several places, use a component recipe instead of repeating the declaration.