Skip to contents
Interfaces DS
Landing Page

Styling

Choose a surface, align its controls, and apply the same state and typography rules across components.

On this page

Load the styles

After adding a component, check the global stylesheet configured in components.json. The registry style entries add imports for ids-styles.css and ids-motion.css. These are example paths when the global stylesheet is in app/.

CSS
/* app/globals.css */
@import "tailwindcss";
@import "tw-animate-css";
@import "../styles/ids-styles.css";
@import "../styles/ids-motion.css";

Control sizes

Use the same size for adjacent buttons, inputs, and selectors. At the default root font size, compact controls are 36 px tall, standard controls are 44 px, and large controls are 48 px. Toggle and Toggle Group use a smaller toolbar scale of 28, 32 and 36 px, with 44 px touch targets. An icon button is as wide as it is tall. Compact targets expand to 44 px on touch devices. Base UI triggers keep the size and surface of the button supplied to them.

Use --ds-control-sm, --ds-control-md, and --ds-control-lg for custom controls alongside the library. A focused control has a 2 px outline with a 2 px offset. Inside a clipped region, the outline sits inside the edge.

Surfaces and spacing

Buttons have a capsule profile and icon actions are circular. Fields share the same height with a smaller corner radius. Primary actions settle on press, secondary actions use a soft fill, and floating menus use a fine edge and a diffuse shadow. Use one raised primary action per group.

A card uses a single surface with 24 px of space around its content. Align the title, body, and footer action to the same edge. Separate card sections with space. In a table, place a single rule below the column headings and use a subtle fill for totals. View the Card example.

Choose a surface

Panel
Card and Alert share the panel background, shadow and corner radius. Card uses a 24 px content inset. Alert uses 16 px to keep a short message compact.
Field
Use the recessed surface for editable values. Keep the label above the field and align the control with adjacent actions.
Anchored popup
Menus, Select, Popover and Hover Card share a floating surface. A menu option follows the outer corner minus the border and list padding. At the default sizes, a 16 px outer corner, 1 px border and 4 px inset give the option an 11 px corner.
Modal
Dialog uses the floating material with a backdrop. Sheet and Drawer carry the same radius on their free edges. The content inset drops to 16 px at 440 px and below.

Set these two roles after importing the Dashboard theme to change panel and popup corners independently. The menu highlight follows its popup automatically.

CSS
[data-ids-theme="dashboard"] {
  --ds-radius-panel: 1.25rem;
  --ds-radius-flyout: 1.125rem;
}
Read the complete design rules

Set theme tokens

Tailwind utilities such as bg-background, text-foreground, and border-border read the semantic variables in ids-styles.css. Write your overrides after the imports. The default values live on :root. Apply the dark class to html to use the dark values and enable the dark: utilities.

For neutral actions, use --secondary at rest, --secondary-hover on hover, and --secondary-active while pressed. Pair all three with --secondary-foreground. Each step gets darker in the light theme and lighter in the dark theme.

Pair a solid danger fill with --danger-foreground on buttons and badges. Use --danger-text for an error message on the field’s surrounding surface. Check the pair in both color modes, including hover and press.

CSS
:root {
  --primary: #214a42;
  --primary-foreground: #ffffff;
  --primary-hover: #173a33;
  --primary-active: #102c26;
}

.dark {
  --primary: #b9ded3;
  --primary-foreground: #102c26;
  --primary-hover: #d0eee5;
  --primary-active: #a1cdc0;
}

Style a component part

Use className on the part for a local change. For a rule that applies to every instance, target its actual data-slot. This example sets the width of the popup rendered by Dialog.

CSS
[data-slot="dialog-content"] {
  max-inline-size: min(36rem, calc(100vw - 2rem));
}

Theme portaled content

Place app-wide variables and theme selectors on the document root. Menus and dialogs can mount under body, outside the layout that rendered their trigger. A theme set on html reaches both places.

The dashboard styles used in these docs require ids-dashboard.css after the base styles and data-ids-theme="dashboard" on html. The dark class still controls the light and dark palette.

TSX
<html lang="en" data-ids-theme="dashboard">
  <body>{children}</body>
</html>