```
## Improve efficiency and ship better code
There’s a reason the world’s largest developer teams rely on Stack Overflow Enterprise—it leads to better product and allows distributed teams to securely collaborate and share knowledge.
The rocket here doesn’t add meaningful information.
### Images accompanied by text[](#images-accompanied-by-text)
If an image has a label nearby, leave the alt-text blank.
```html
…
…
```
## TOP LEADERBOARD: 728X90
This ad unit is the most visible on the site.
The nearby text here already explains what the graphic illustrates. If there was alt-text here, screen readers would repeat information to the user.
Information
**Note:** In these cases, leaving the alt attribute empty (`alt=""`) will cause a screenreader to skip over the image. **Never _remove_ the alt-attribute.** When a screenreader comes to an image without an alt attribute, it will dictate the filename (Eg. "SO underscore logo dot png").
## How to add alt-text[](#how-to-add-alt-text)
### Using [](#using-ltimggt)
Inside an `` tag, add the alt-text inside the `alt` attribute:
```html
```
### Using inline SVG[](#using-inline-svg)
Inline SVG doesn’t support the `alt` attribute, so instead add two wai-aria attributes: `role="img"` and `aria-label="The alt-text."`:
```html
```
* * *
This content was adapted from [Axess Lab](https://axesslab.com/alt-texts/).
---
### Page: Accessibility
URL: https://stackoverflow.design/system/accessibility/intro
Date: 2026-08-13T14:42:32.952Z
description: A non-comprehensive guide to accessibility best practices when using Stacks.
Content:
## Target[](#target)
All Stack Overflow product UIs must conform to the AA conformance level of the Web Content Accessibility Guidelines (WCAG) 2.2 with a few exceptions around color contrast documented below.
### High contrast modes[](#high-contrast-modes)
When high contrast mode is enabled, Stack Overflow product UIs must meet or exceed the [Success Criterion 1.4.6 Contrast (Enhanced)](https://www.w3.org/TR/WCAG22/#contrast-enhanced) of the [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/) and should conform to the remaining [AAA conformance level rules](https://www.w3.org/TR/WCAG22/#cc1) when reasonably achievable. This only applies to the subset of Stack Overflow products that provide high contrast modes. **Note: not all Stack Overflow products are expected to support high contrast modes**.
## Visual accessibility[](#visual-accessibility)
Stack Overflow product UIs MUST conform to a custom conformance level of the Accessible Perceptual Contrast Algorithm (APCA). This custom conformance level replaces the [AA conformance level](https://www.w3.org/TR/WCAG22/#cc1) of the [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/) for color contrast.
### Color & contrast[](#color--contrast)
Stacks aims to equip you with an accessible color palette and has been tested against WCAG AA, WCAG AAA and the newer APCA color standards. Most of our color combinations meet WCAG AA and APCA levels defined below. We also offer high contrast mode which offers a greater level of contrast.
#### Contrast ratios[](#contrast-ratios)
Contrast is the difference in luminance or color between any two elements. All visual readers require ample luminance contrast for fluent readability. Stack Overflow products must conform to a custom conformance level of the Accessible Perceptual Contrast Algorithm (APCA). Based on our custom conformance level, all text must have a Lightness contrast (Lc) value of 60, body copy must have a Lc value of 75, icons must have a Lc value of 45, and placeholder and disabled text must have a Lc of 30. These numbers will be negative when calculating for dark mode.
#### Don't
Use low luminance contrast that fails our standards.
Button
Robotics
#### Do
Use luminance contrast that meets our standards as defined above.
Button
Robotics
#### Visual cues[](#visual-cues)
Visual readers with color vision deficiency (CVD) have problems differentiating some hues and therefore these users need help discerning differences between items. This means that color (hue) should never be the sole means of communicating information and should always be paired with a non-color dependent indicator to accommodate all visual users.
#### Don't
Use color alone to convey meaning.
#### Do
Use an icon alongside color to convey meaning.
## Focus states[](#focus-states)
Some people navigate through a website by using a keyboard or other device (instead of a mouse). A focus state should clearly let users know which item they’re on and is ready to interact with. Stack’s has taken a hybrid approach in using both the browser’s default styles (smaller interactive components like text links) and a custom focus ring.
### Foundation for custom approach[](#foundation-for-custom-approach)
The custom approach adds two different outline rings on the inside of the component. The outer ring color uses `secondary-theme-400` (matching the primary button color) and the inner ring color uses `white` (matching the background).
Button
Default
Button
Focus
The outer ring color will always display as the theme color even when applied to a `muted` or `danger` styled button. This ensures the focus ring maintains a 3:1 color contrast ratio for any adjacent colors (WCAG level AA) within any theme (assuming the `secondary-theme` color already passes the 3:1 contrast ratio).
Button
Tonal default
Button
Tonal focus
Button
Danger filled default
Button
Danger filled focus
### Meeting level AAA[](#meeting-level-aaa)
Both focus rings are always 2px thick. This allows the focus state to meet [WCAG 2.4.13 Focus Appearance (AAA)](https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html) standards for High Contrast mode. Whenever possible, the rings should be added to the inside of the component so we can better ensure that the rings don’t get accidentally cut off by the surrounding layout (which helps us to meet [WCAG 2.4.11 Focus Not Obscured AA](https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum.html)). However, this does result in a padding reduction within the element, surrounding the text. When choosing to set the focus rings on the inside (inset), the component must have at least 4px of padding at the smallest size. This has been applied to buttons, button groups, navigation, pagination and topbar.
When the padding amount is not sufficient enough to support a double ring on the inside of the component, the rings are placed on the outside. The components included are tags, toggles, form elements (input fields, selects, radio/checkboxes…), block links and the editor.
javascript
Tag default
javascript
Tag focus
Toggle default
Toggle focused
### Consistent style patterns[](#consistent-style-patterns)
#### Filled[](#filled)
Any component that already has an existing background color that fills the shape will maintain its original fill color.
* [Product](#)
Navigation active default
* [Product](#)
Navigation active focus
Off Weekly
Toggle (multi) default
Off Weekly
Toggle (multi) focused
#### Bordered[](#bordered)
For components that have an existing border around the component when not in focus, a background fill color is added in addition to the focus rings. This ensures there’s a strong enough visual difference between the non-focus and focus state. These patterns are maintained across all components for consistency.
page 2
Pagination default
page 2
Pagination focus
#### Floating[](#floating)
Components without an existing fill or border will only display the double rings on focus. Since the inner ring matches the background color in most cases, this will visually appear like a single ring around the perimeter of the component.
[Home](#)
Navigation default
[Home](#)
Navigation focus
List Insert Document Code Link
Editor icon default
List Insert Document Code Link
Editor icon focus
#### Exceptions[](#exceptions)
The exceptions to this pattern are the `Clear` button variations. All buttons display a background fill layer when in focus. `Clear`, `Outline` and `Filled` styles will all look the same when in focus. The fill color was chosen to match the existing `Filled` style.
Button
Clear default
Button
Clear focus
Button
Tonal default
Button
Tonal default focus
### Browser default[](#browser-default)
Some focusable elements and Stacks components currently do not include custom focus styling. These elements will instead render the browser-default focus indicators.
## Viewport size[](#viewport-size)
All Stack Overflow products must conform to the [WCAG 2.2 SC 1.4.10: Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html). This requires that our product UIs support viewports as small as **320px x 256px** without requiring the user scrolling in multiple dimensions (unless an element requires it for usage or meaning). Very few users will ever use a viewport this small, but it’s important to support it so users can zoom in up to 400% and still have a usable experience. At 400% zoom, a 320x256 viewport translates to 1280x1024, which is a common resolution for many users. Supporting this small viewport size ensures that users with low vision can still use our products effectively.
### Exceptions[](#exceptions-1)
There are some exceptions to this rule. Some elements such as tables and videos may require horizontal scrolling on small viewports. In these cases, it’s acceptable to require scrolling in two dimensions. See the [WCAG 2.2 documentation on Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html#content-exceptions-for-reflow) for detailed guidance.
## Landmarks[](#landmarks)
[ARIA landmarks](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role) should be used across Stack Overflow product pages to provide clear navigation structures for users relying on assistive technologies. Landmarks are inserted into the page explicitly using the `role` attribute on an element (e.g. `role="search"`, etc…) or by leveraging semantic HTML (e.g. an `header` element is given automatically the `banner` landmark).
Using semantic HTML elements should be preferred over using the `role` attribute whenever possible.
For a comprehensive guide on using ARIA landmark roles refer to:
* [WCAG ARIA11 Technique](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA11)
* [Using HTML landmark roles to improve accessibility](https://developer.mozilla.org/en-US/blog/aria-accessibility-html-landmark-roles)
* [Landmarks Browser Extension](https://matatk.agrip.org.uk/landmarks)
---
## Collection: base
### Page: Backgrounds
URL: https://stackoverflow.design/system/base/backgrounds/
Date: 2026-08-13T14:42:32.969Z
description: Atomic classes for controlling the background properties of an element.
Content:
## Background size[](#background-size)
Class
Output
`.bg-auto`
background-size: auto;
`.bg-cover`
background-size: cover;
`.bg-contain`
background-size: contain;
## Background repeat[](#background-repeat)
Class
Output
`.bg-repeat`
background-repeat: repeat;
`.bg-no-repeat`
background-repeat: no-repeat;
`.bg-repeat-x`
background-repeat: repeat-x;
`.bg-repeat-y`
background-repeat: repeat-y;
## Background position[](#background-position)
Class
Output
`.bg-bottom`
background-position: bottom;
`.bg-center`
background-position: center;
`.bg-left`
background-position: left;
`.bg-left-bottom`
background-position: left bottom;
`.bg-left-top`
background-position: left top;
`.bg-right`
background-position: right;
`.bg-right-bottom`
background-position: right bottom;
`.bg-right-top`
background-position: right top;
`.bg-top`
background-position: top;
### Background position examples[](#background-position-examples)
```html
…
…
…
…
…
…
…
…
…
```
`.bg-bottom`
`.bg-center`
`.bg-left`
`.bg-left-bottom`
`.bg-left-top`
`.bg-right`
`.bg-right-bottom`
`.bg-right-top`
`.bg-top`
## Background attachment[](#background-attachment)
Class
Output
`.bg-fixed`
background-attachment: fixed;
`.bg-local`
background-attachment: local;
`.bg-scroll`
background-attachment: scroll;
## Background image[](#background-image)
Class
Output
`.bg-image-none`
background-image: none;
## Background utilities[](#background-utilities)
### Loading[](#loading)
Adding the `.bg-loading` class applies a shimmering gradient animation to a container’s background. Use it to create flexible skeleton placeholders that mimic the shape and layout of content while it loads.
```html
Loading…
```
Loading…
### Confetti[](#confetti)
Adding the confetti background utility adds confetti to any block-level element. You can choose the animated version, or static version. The animated version respects `prefers-reduced-motion` and displays the static version of the background when necessary. No JavaScript required.
```html
…
…
```
Animated
Static
---
### Page: Border radius
URL: https://stackoverflow.design/system/base/border-radius
Date: 2026-08-13T14:42:32.976Z
description: Stacks provides atomic classes for border radius.
Content:
## Classes[](#classes)
Abbreviation
Output
Definition
Responsive?
`.bar0`
border-radius: 0
Apply a border radius of 0 to all corners
Yes
`.btlr0`
border-top-left-radius: 0
Apply a border radius of 0 to the top left corner
`.btrr0`
border-top-right-radius: 0
Apply a border radius of 0 to the top right corner
`.bblr0`
border-bottom-left-radius: 0
Apply a border radius of 0 to the bottom left corner
`.bbrr0`
border-bottom-right-radius: 0
Apply a border radius of 0 to the bottom right corner
`.btr0`
border-top-left-radius: 0; border-top-right-radius: 0
Apply a border radius of 0 to the top corners
`.brr0`
border-top-right-radius: 0; border-bottom-right-radius: 0
Apply a border radius of 0 to the right corners
`.bbr0`
border-bottom-left-radius: 0; border-bottom-right-radius: 0
Apply a border radius of 0 to the bottom corners
`.blr0`
border-bottom-left-radius: 0; border-top-left-radius: 0
Apply a border radius of 0 to the left corners
`.bar-md`
border-radius: 10px
Apply a border radius of 10px to all corners
`.btlr-md`
border-top-left-radius: 10px
Apply a border radius of 10px to the top left corner
`.btrr-md`
border-top-right-radius: 10px
Apply a border radius of 10px to the top right corner
`.bblr-md`
border-bottom-left-radius: 10px
Apply a border radius of 10px to the bottom left corner
`.bbrr-md`
border-bottom-right-radius: 10px
Apply a border radius of 10px to the bottom right corner
`.btr-md`
border-top-left-radius: 10px; border-top-right-radius: 10px
Apply a border radius of 10px to the top corners
`.brr-md`
border-top-right-radius: 10px; border-bottom-right-radius: 10px
Apply a border radius of 10px to the right corners
`.bbr-md`
border-bottom-left-radius: 10px; border-bottom-right-radius: 10px
Apply a border radius of 10px to the bottom corners
`.blr-md`
border-bottom-left-radius: 10px; border-top-left-radius: 10px
Apply a border radius of 10px to the left corners
`.bar-pill`
border-radius: 1000px
Apply a border radius of 1000px to each corner for a 100% rounding of the left and right corners
`.bar-circle`
border-radius: 100%
Apply a border radius of 100% to each corner for a circular appearance
Show All Classes
## Examples[](#examples)
### All corners[](#all-corners)
```html
…
…
…
…
```
.bar0
.bar-md
.bar-circle
.bar-pill
### Top left corner[](#top-left-corner)
```html
…
…
```
.btlr0
.btlr-md
### Top right corner[](#top-right-corner)
```html
…
…
```
.btrr0
.btrr-md
### Bottom right corner[](#bottom-right-corner)
```html
…
…
```
.bbrr0
.bbrr-md
### Bottom left corner[](#bottom-left-corner)
```html
…
…
```
.bblr0
.bblr-md
### Top corners[](#top-corners)
```html
```
.bbr0
.bbr-md
### Left corners[](#left-corners)
```html
…
…
```
.blr0
.blr-md
### Right corners[](#right-corners)
```html
…
…
```
.brr0
.brr-md
---
### Page: Borders
URL: https://stackoverflow.design/system/base/borders
Date: 2026-08-13T14:42:32.992Z
description: Stacks provides atomic classes for borders.
Content:
## Classes[](#classes)
Class
Output
Apply border to
Responsive?
`.ba`
border: solid 1px
All sides
Yes
`.bt`
border-top: solid 1px
Top
Yes
`.bb`
border-bottom: solid 1px
Bottom
Yes
`.bl`
border-left: solid 1px
Left
Yes
`.br`
border-right: solid 1px
Right
Yes
`.by`
border-top: solid 1px; border-bottom: solid 1px;
Top and bottom
`.bx`
border-left: solid 1px; border-right: solid 1px;
Left and right
## Examples[](#examples)
```html
…
…
…
…
…
…
…
```
All sides
Top
Bottom
Left
Right
Top and bottom
Left and right
## Width[](#width)
### Width classes[](#width-classes)
Class
Output
Border width, side(s)
Responsive?
`.baw0`
border-width: 0
Zero, all sides
`.btw0`
border-top-width: 0
Zero, top
Yes
`.bbw0`
border-bottom-width: 0
Zero, bottom
Yes
`.blw0`
border-left-width: 0
Zero, left
Yes
`.brw0`
border-right-width: 0
Zero, right
Yes
`.byw0`
border-top-width: 0; border-bottom-width: 0;
Zero, top and bottom
`.bxw0`
border-left-width: 0; border-right-width: 0;
Zero, left and right
`.baw1`
border-width: 1px
1px, all
`.btw1`
border-top-width: 1px
1px, top
`.bbw1`
border-bottom-width: 1px
1px, bottom
`.blw1`
border-left-width: 1px
1px, left
`.brw1`
border-right-width: 1px
1px, right
`.byw1`
border-top-width: 1px; border-bottom-width: 1px;
1px, top and bottom
`.bxw1`
border-left-width: 1px; border-right-width: 1px;
1px, left and right
`.baw2`
border-width: 2px
2px, all
`.btw2`
border-top-width: 2px
2px, top
`.bbw2`
border-bottom-width: 2px
2px, bottom
`.blw2`
border-left-width: 2px
2px, left
`.brw2`
border-right-width: 2px
2px, right
`.byw2`
border-top-width: 2px; border-bottom-width: 2px;
2px, top and bottom
`.bxw2`
border-left-width: 2px; border-right-width: 2px;
2px, left and right
`.baw3`
border-width: 4px
4px, all
`.btw3`
border-top-width: 4px
4px, top
`.bbw3`
border-bottom-width: 4px
4px, bottom
`.blw3`
border-left-width: 4px
4px, left
`.brw3`
border-right-width: 4px
4px, right
`.byw3`
border-top-width: 4px; border-bottom-width: 4px;
4px, top and bottom
`.bxw3`
border-left-width: 4px; border-right-width: 4px;
4px, left and right
### Width examples[](#width-examples)
```html
…
…
…
…
…
```
.ba
.ba.brw0
.ba.bbw0
.ba.baw2
.ba.baw3
## Style[](#style)
### Style classes[](#style-classes)
Class
Output
Side(s)
`.bas-solid`
border-style: solid
All sides
`.bts-solid`
border-top-style: solid
Top
`.brs-solid`
border-right-style: solid
Right
`.bbs-solid`
border-bottom-style: solid
Bottom
`.bls-solid`
border-left-style: solid
Left
`.bas-dashed`
border-style: dashed
All sides
`.bts-dashed`
border-top-style: dashed
Top
`.brs-dashed`
border-right-style: dashed
Right
`.bbs-dashed`
border-bottom-style: dashed
Bottom
`.bls-dashed`
border-left-style: dashed
Left
### Style examples[](#style-examples)
```html
…
…
…
```
Solid border style
Dashed border style
Dashed border right style
## Color[](#color)
Each color stop is available as a border class. See the [colors documentation](/system/foundation/colors#classes) for all available classes.
---
### Page: Box shadow
URL: https://stackoverflow.design/system/base/box-shadow
Date: 2026-08-13T14:42:33.014Z
description: Box shadow atomic classes allow you to change an element's box shadow quickly.
Content:
## Classes[](#classes)
Class
Hover?
Focus?
Responsive?
`.bs-none`
Yes
`.bs-sm`
Yes
`.bs-md`
Yes
`.bs-lg`
Yes
`.bs-xl`
`.bs-ring`
Yes
Yes
## Examples[](#examples)
```html
…
…
…
…
…
```
.bs-sm
.bs-md
.bs-lg
.bs-xl
.bs-ring
---
### Page: Box sizing
URL: https://stackoverflow.design/system/base/box-sizing
Date: 2026-08-13T14:42:33.016Z
description: Box-sizing atomic classes allow one to determine what is used to determine an element's width or height.
Content:
## Classes[](#classes)
Class
Output
Definition
`.box-content`
box-sizing: content-box;
Indicates that the element's width and height affects only the element's content box, that is the area minus the element's margin, padding, and borders. This is the default browser value.
`.box-border`
box-sizing: border-box;
Indicates that the element's width and height affects the entire element. This is the preferred default value for Stacks.
`.box-unset`
box-sizing: unset;
Removes the previously set box-sizing value, reverting it back to the initial browser value.
## Examples[](#examples)
```html
…
…
…
```
**Parent container**
**Child container**
**box-sizing: content-box;**
width: 100%;
padding: 0;
border-width: 0;
**Parent container**
**Child container**
**box-sizing: content-box;**
width: 100%;
padding: 12px;
border-width: 1px;
**Parent container**
**Child container**
**box-sizing: border-box;**
width: 100%;
padding: 12px;
border-width: 1px;
---
### Page: Current color
URL: https://stackoverflow.design/system/base/current-color
Date: 2026-08-13T14:42:33.018Z
description: Atomic classes allow you to quickly add currentColor to an element's fill or stroke property.
Content:
## Classes[](#classes)
Class
Output
`.fill-current`
fill: currentColor;
`.stroke-current`
stroke: currentColor;
## Examples[](#examples)
When applied to an SVG, applying `currentColor` to the fill or stroke property allows you to inherit the parent element’s text color or the text color applied to the element itself.
```html
```
---
### Page: Cursors
URL: https://stackoverflow.design/system/base/cursors
Date: 2026-08-13T14:42:33.029Z
description: Atomic cursor classes allow you to quickly change an element's cursor behavior.
Content:
## Classes[](#classes)
Class
Output
`.c-auto`
cursor: auto;
`.c-default`
cursor: default;
`.c-pointer`
cursor: pointer;
`.c-text`
cursor: text;
`.c-wait`
cursor: wait;
`.c-move`
cursor: move;
`.c-not-allowed`
cursor: not-allowed;
`.c-help`
cursor: help;
## Examples[](#examples)
```html
…
…
…
…
…
…
…
…
```
.c-auto
.c-default
.c-pointer
.c-text
.c-wait
.c-move
.c-not-allowed
.c-help
---
### Page: Display
URL: https://stackoverflow.design/system/base/display
Date: 2026-08-13T14:42:33.031Z
description: Display atomic classes allow you to change an element's display quickly.
Content:
## Classes[](#classes)
Class
Output
Definition
Responsive?
Print?
`.d-block`
display: block;
This turns any element into a block-level element.
Yes
Yes
`.d-inline`
display: inline;
Turns any element into an inline element that flows like text.
Yes
`.d-inline-block`
display: inline-block;
Turns any element into a block-level box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would)
Yes
`.d-flex`
display: flex;
Lays out its content according to the flexbox model.
Yes
`.d-inline-flex`
display: inline-flex;
This makes the element behave like an inline element and lays out its content according to the flexbox model.
Yes
`.d-grid`
display: grid;
This lays out an element and its contents using grid layout.
Yes
`.d-inline-grid`
display: inline-grid;
This makes the element behave like an inline element and lays out its content according to the grid model.
Yes
`.d-table`
display: table;
This makes your element behave like table HTML elements. It defines a block-level box.
`.d-table-cell`
display: table-cell;
These elements behave like td HTML elements.
`.d-none`
display: none;
Effectively removes the element from the DOM. Useful for showing / hiding elements. To hide things when the page is printed, apply .print:d-none
Yes
Yes
`.d-unset`
display: unset;
Removes any display property from the element.
---
### Page: Flex
URL: https://stackoverflow.design/system/base/flex
Date: 2026-08-13T14:42:33.034Z
description: Stacks provides extensive utility and helper classes for flex layouts. If you are new to flex layouts, check out this interactive introduction by Joshua Comeau.
Content:
## Basic flex layout[](#basic-flex-layout)
A flex layout is initiated with the `.d-flex` class. By default, `display: flex;` starts a non-wrapping row. To convert it to a column, apply the `.fd-column` atomic class.
```html
…
…
…
…
```
.flex--item
.flex--item
.flex--item
.flex--item
## Fluid[](#fluid)
By default, all flex items will only be as wide as their content. If you would like a flex item or all the flex items to fill the remaining space, apply the `.fl-grow1` to the individual item, or `.flex__fl-equal` to the parent to apply to all children.
### Fluid examples[](#fluid-examples)
```html
…
…
…
…
…
```
.flex--item.fl-grow1
.flex--item
.flex--item
.flex--item
.flex--item
## Fixed cells[](#fixed-cells)
You can either fix the width of an individual element or fix the width of all child elements within a parent container by setting the width on the parent. The cell widths are based on a 12-column flex layout system.
### Fixed classes[](#fixed-classes)
Individual Width
Output
All Items
`.flex--item1`
flex-basis: 8.333333333%;
`.flex__allitems1`
`.flex--item2`
flex-basis: 16.666666667%;
`.flex__allitems2`
`.flex--item3`
flex-basis: 24.999999999%;
`.flex__allitems3`
`.flex--item4`
flex-basis: 33.333333332%;
`.flex__allitems4`
`.flex--item5`
flex-basis: 41.666666665%;
`.flex__allitems5`
`.flex--item6`
flex-basis: 50%;
`.flex__allitems6`
`.flex--item7`
flex-basis: 58.333333331%;
`.flex__allitems7`
`.flex--item8`
flex-basis: 66.666666664%;
`.flex__allitems8`
`.flex--item9`
flex-basis: 74.999999997%;
`.flex__allitems9`
`.flex--item10`
flex-basis: 83.33333333%;
`.flex__allitems10`
`.flex--item11`
flex-basis: 91.666666663%;
`.flex__allitems11`
`.flex--item12`
flex-basis: 100%;
`.flex__allitems12`
### Fixed examples[](#fixed-examples)
```html
…
…
…
…
…
…
…
…
…
```
.flex--item\[x\]
.flex--item2
.flex--item10
.flex--item\[x\] and standard .flex--item
.flex--item3
.flex--item6
.flex--item
.d-flex.flex\_\_allitems4
.flex--item
.flex--item
.flex--item
.flex--item
## Helpers[](#helpers)
We have a few helper classes you can add to a `.d-flex` container that affect the child `.flex--item`s.
### Helper classes[](#helper-classes)
Class
Definition
`.flex__center`
Centers child elements along a parent's main and cross axis.
`.flex__fl-shrink0`
Disables shrinking from all child elements
`.flex__fl-equal`
Makes each child element grow equally
### Helpers examples[](#helpers-examples)
```html
…
…
…
…
…
…
…
```
.flex\_\_center
.flex--item
.flex\_\_fl-shrink0
.flex--item
.flex--item
.flex--item
.flex\_\_fl-equal
.flex--item
.flex--item
.flex--item
## Nested flex layouts[](#nested-flex-layouts)
Flex layouts can be nested within each other. This allows you to create unique, custom layouts without needing to create new, custom code or override existing styles.
### Nested examples[](#nested-examples)
```html
…
…
…
…
```
.flex--item
.flex--item
.flex--item2
.flex--item2
## Gutters[](#gutters)
Warning
**Deprecation:** gutters will be removed in a future release.
Please use [gap classes](/product/base/gap) to set spacing on flex items.
Sometimes gutters are desired between cells. To do so apply the appropriate class to the parent wrapper. The gutter applies a margin to all sides. The sizes available are the same as [the spacing units](/product/base/spacing).
### Gutter classes[](#gutter-classes)
Class
Size
`.gs2`
2px
`.gs4`
4px
`.gs6`
6px
`.gs8`
8px
`.gs12`
12px
`.gs16`
16px
`.gs24`
24px
`.gs32`
32px
`.gs48`
48px
`.gs64`
64px
`.gsx`
Applies margins only to left and right
`.gsy`
Applies margins only to top and bottom
### Gutter examples[](#gutter-examples)
```html
…
…
…
…
…
…
```
.gs16
.gs16
.gs16
.gs16
.gs16.gsx — Row gutters only
.gs16.gsx — Row gutters only
.gs16.gsx — Row gutters only
.gs16.gsx — Row gutters only
.gs16.gsy — Column gutters only
.gs16.gsy — Column gutters only
.gs16.gsy — Column gutters only
.gs16.gsy — Column gutters only
### Nested gutters[](#nested-gutters)
Warning
**Note:** Nested flex layouts with [gutter spacing](#gutters) will conflict with each other in unpredictable ways. **TL;DR?** Don't stick a `.d-flex` directly into a `.d-flex`, instead stick a `.d-flex` into a `.flex--item` like so:
If you are nesting a flex layout with gutter spacing into another flex layout that also has gutter spacing, the child’s parent wrapper margins will be overwritten by the parent. To have the child flex layout’s gutter spacing honored, you have to put the child flex layout within a `.flex--item` wrapper first. This allows the parent and child flex layout gutter spacing to act correctly without interfering with each other.
#### Do[](#do)
```html
```
.flex--item
.flex--item
.flex--item
## Flex direction[](#flex-direction)
On a flex container, you can set the direction of the child items.
### Flex direction classes[](#flex-direction-classes)
Class
Definition
Responsive?
`.fd-row`
Sets the flex direction to a row.
Yes
`.fd-row-reverse`
Reverses the row flex direction.
Yes
`.fd-column`
Sets the flex direction to a column.
Yes
`.fd-column-reverse`
Reverses the column flex direction.
Yes
### Flex direction examples[](#flex-direction-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
```
.fd-row
Default
.flex--item 1
.flex--item 2
.flex--item 3
.fd-row-reverse
.flex--item 1
.flex--item 2
.flex--item 3
.fd-column
.flex--item 1
.flex--item 2
.flex--item 3
.fd-column-reverse
.flex--item 1
.flex--item 2
.flex--item 3
## Flex wrap[](#flex-wrap)
On a flex container, you can control if the children wrap.
### Flex wrap classes[](#flex-wrap-classes)
Class
Definition
Responsive?
`.fw-wrap`
Wraps the child cells within a parent.
Yes
`.fw-reverse`
Reverses the wrap direction.
Yes
`.fw-nowrap`
Removes the wrap direction.
Yes
### Flex wrap examples[](#flex-wrap-examples)
```html
…
…
…
…
…
…
```
.fw-wrap
.flex--item 1
.flex--item 2
.flex--item 3
.flex--item 4
.flex--item 5
.flex--item 6
.flex--item 7
.flex--item 8
.fw-reverse
.flex--item 1
.flex--item 2
.flex--item 3
.flex--item 4
.flex--item 5
.flex--item 6
.flex--item 7
.flex--item 8
.fw-nowrap
Default
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
## Justify content[](#justify-content)
Flex items can be controlled with atomic classes on the container’s main axis. This means controlling how a `.flex--item` is aligned left to right when in an `.fd-row`, and top and bottom in an `.fd-column`.
### Justify content classes[](#justify-content-classes)
Class
Definition
Responsive?
`.jc-center`
Centers child elements along the parent's main axis.
Yes
`.jc-end`
Aligns child elements at the end of the parent's main axis.
Yes
`.jc-space-around`
Equally distributes the remaining space around child elements. Note that this doesn't mean the spaces are visually equal, but that the same space unit is applied to both sides of a child element. The first item would have one unit of space against the container edge, but the next item would have two units of space between itself and the first item.
Yes
`.jc-space-between`
Evenly distributes the space between child elements along a parent's main axis with the first item starting on the start line and the last item on the end line.
Yes
`.jc-space-evenly`
The spacing between any two items (and spacing between the edges) are equal.
Yes
`.jc-start`
Aligns child elements at the start of the parent's main axis.
Yes
### Justify content examples[](#justify-content-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.jc-center
.flex--item
.flex--item
.flex--item
.jc-end
.flex--item
.flex--item
.flex--item
.jc-space-around
.flex--item
.flex--item
.flex--item
.jc-space-between
.flex--item
.flex--item
.flex--item
.jc-space-evenly
.flex--item
.flex--item
.flex--item
.jc-start
Default
.flex--item
.flex--item
.flex--item
## Align items[](#align-items)
Flex items can be controlled with atomic classes on the container’s cross axis. This means controlling how a `.flex--item` is aligned top to bottom when in an `.fd-row`, and left to right in an `.fd-column`.
### Align items classes[](#align-items-classes)
Class
Definition
Responsive?
`.ai-baseline`
Aligns child elements along the baseline of a parent's cross axis.
Yes
`.ai-center`
Centers child elements along the parent's cross axis.
Yes
`.ai-end`
Places child elements at the end of the parent's cross axis.
Yes
`.ai-start`
Places child elements at the start of the parent's cross axis.
Yes
`.ai-stretch`
Stretches child elements along the parent's cross axis.
Yes
### Align items examples[](#align-items-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.ai-baseline
.flex--item
.flex--item
.flex--item
.ai-center
.flex--item
.flex--item
.flex--item
.ai-end
.flex--item
.flex--item
.flex--item
.ai-start
.flex--item
.flex--item
.flex--item
.ai-stretch
Default
.flex--item
.flex--item
.flex--item
## Align content[](#align-content)
Flex items can be controlled with atomic classes on the container’s cross axis.
### Align content classes[](#align-content-classes)
Class
Definition
`.ac-center`
Distributes child elements starting from the center along a parent's cross axis. This only works with more than one line.
`.ac-end`
Distributes child elements starting from the end along a parent's cross axis. This only works with more than one line.
`.ac-space-around`
Distributes child elements with space around along a parent's cross axis. This only works with more than one line.
`.ac-space-between`
Distributes child elements with space between along a parent's cross axis. This only works with more than one line.
`.ac-start`
Distributes child elements starting from the start along a parent's cross axis. This only works with more than one line.
`.ac-stretch`
Distributes child elements stretching them along a parent's cross axis. This only works with more than one line.
### Align content examples[](#align-content-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.ac-center
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.ac-end
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.ac-space-around
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.ac-space-between
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.ac-start
Default
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
.flex--item
## Align self[](#align-self)
A flex container’s `align-items` can be overridden on individual items within a flex layout.
### Align self classes[](#align-self-classes)
Class
Definition
Responsive?
`.as-auto`
Auto re-aligns a child element along the parent's main axis based on the ai-\[x\] value.
Yes
`.as-baseline`
Re-aligns a child element along the baseline of the parent's main axis.
Yes
`.as-center`
Centers a child element along the parent's main axis.
Yes
`.as-end`
Re-aligns a child element to the end of the parent's main axis.
Yes
`.as-start`
Re-aligns a child element to the start of the parent's main axis.
Yes
`.as-stretch`
Stretches a child element along the parent's main axis.
Yes
### Align self examples[](#align-self-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.as-auto
Default
.flex--item
.flex--item
.flex--item
.as-baseline
.flex--item
.flex--item
.flex--item
.as-center
.flex--item
.flex--item
.flex--item
.as-end
.flex--item
.flex--item
.flex--item
.as-start
.flex--item
.flex--item
.flex--item
.as-stretch
.flex--item
.flex--item
.flex--item
## Order[](#order)
Within a flex layout, you can force the position of individual elements.
### Order classes[](#order-classes)
Class
Definition
Responsive?
`.order-first`
Places the child element first within a parent container.
Yes
`.order-last`
Places the child element last within a parent container.
Yes
### Order examples[](#order-examples)
```html
…
…
…
…
…
…
```
.order-first
.flex--item 1
.flex--item 2
.flex--item 3
.order-last
.flex--item 1
.flex--item 2
.flex--item 3
## Flex shrink and grow[](#flex-shrink-and-grow)
You can control the growing and shrinking behavior of individual elements within a flex layout.
### Flex classes[](#flex-classes)
Class
Definition
Responsive?
`.fl-grow1`
Sets flex-grow to allow a flex item to grow to fill any available space.
Yes
`.fl-grow0`
Prevents a flex item from growing.
Yes
`.fl-shrink1`
Allows a flex item to shrink if needed.
Yes
`.fl-shrink0`
Prevents a flex item from shrinking.
Yes
`.fl-none`
Prevents a flex item from growing or shrinking.
Yes
`.fl-initial`
Allows a flex item to shrink but not grow, taking into account its initial size.
Yes
`.fl-auto`
Allows a flex item to grow and shrink, taking into account its initial size.
Yes
`.fl-equal`
Allow a flex item to grow and shrink as needed, ignoring its initial size. If all children within a flex layout have .fl-equal enabled, they'll be the same size. See also .flex\_\_fl-equal
Yes
### Flex examples[](#flex-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.fl-grow1
.flex--item
.flex--item
.flex--item
.fl-grow0
.flex--item
.flex--item
.flex--item
.fl-shrink1
.flex--item
.flex--
item
.flex--item
.fl-shrink0
.flex--item
.flex--item
.flex--item
.fl-none
.flex--item
.flex--item
.flex--item
.fl-initial
.flex--item
.flex--item
.flex--item
.fl-auto
.flex--item
.flex--item.ws2
.flex--item
.fl-equal
.flex--item
.flex--item
.flex--item
---
### Page: Floats
URL: https://stackoverflow.design/system/base/floats
Date: 2026-08-13T14:42:33.138Z
description: Float and clear atomic classes allow you to change how an element is positioned within the layout. These should be used when possible to help create consistency.
Content:
## Classes[](#classes)
Class
Output
Definition
`.float-left`
float: left;
Indicates that the element must float on the left side of the parent container.
`.float-right`
float: right;
Indicates that the element must float on the right side of the parent container.
`.float-none`
float: none;
Indicates that the element must not float.
`.clearfix`
`.clearfix();`
This class calls the .clearfix(); mixin, which fixes a layout bug. Floating an object takes it out of the DOM order. When all child itmes within a parent container contain a float property then, the parent container will collapse. The .clearfix class forces the parent container to not collapse.
`.clear-left`
clear: left;
Indicates that the element must be moved down to clear past left floats.
`.clear-right`
clear: right;
Indicates that the element must be moved down to clear past right floats.
`.clear-both`
clear: both;
Indicates that the element must be moved down to clear past left and right floats.
`.clear-none`
clear: none;
Indicates that the element does not need to be moved down to clear past floats.
## Examples[](#examples)
### Floats[](#floats)
```html
```
.float-left
.float-left
.clear-left
.float-right
.float-right
.clear-right
.float-left
.float-right
.clear-both
---
### Page: Gap
URL: https://stackoverflow.design/system/base/gap
Date: 2026-08-13T14:42:33.150Z
description: Atomic CSS gap classes allow you to set spacing on the direct children of elements with flexbox and grid layouts.
Content:
## Gap classes[](#gap-classes)
Class
Output
Definition
Responsive?
`.g0`
gap: 0 0
Add no space between items
Yes
`.g1`
gap: 1px 1px
Space out items by 1px
Yes
`.g2`
gap: 2px 2px
Space out items by 2px
Yes
`.g4`
gap: 4px 4px
Space out items by 4px
Yes
`.g6`
gap: 6px 6px
Space out items by 6px
Yes
`.g8`
gap: 8px 8px
Space out items by 8px
Yes
`.g12`
gap: 12px 12px
Space out items by 12px
Yes
`.g16`
gap: 16px 16px
Space out items by 16px
Yes
`.g24`
gap: 24px 24px
Space out items by 24px
Yes
`.g32`
gap: 32px 32px
Space out items by 32px
Yes
`.g48`
gap: 48px 48px
Space out items by 48px
Yes
`.g64`
gap: 64px 64px
Space out items by 64px
Yes
### Examples[](#examples)
```html
…
…
…
…
…
…
…
…
…
…
…
```
.g0
.g1
.g2
.g4
.g6
.g8
.g12
.g16
.g24
.g32
.g48
.g64
## Column gap[](#column-gap)
Spacing can be set on just the x-axis with `.gx` classes. They can be used independently or in combination with other atomic gap classes.
Class
Output
Definition
Responsive?
`.gx0`
row-gap: 0
Add no space between columns
Yes
`.gx1`
row-gap: 1px
Space out columns by 1px
Yes
`.gx2`
row-gap: 2px
Space out columns by 2px
Yes
`.gx4`
row-gap: 4px
Space out columns by 4px
Yes
`.gx6`
row-gap: 6px
Space out columns by 6px
Yes
`.gx8`
row-gap: 8px
Space out columns by 8px
Yes
`.gx12`
row-gap: 12px
Space out columns by 12px
Yes
`.gx16`
row-gap: 16px
Space out columns by 16px
Yes
`.gx24`
row-gap: 24px
Space out columns by 24px
Yes
`.gx32`
row-gap: 32px
Space out columns by 32px
Yes
`.gx48`
row-gap: 48px
Space out columns by 48px
Yes
`.gx64`
row-gap: 64px
Space out columns by 64px
Yes
### Column examples[](#column-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
```
.gx0
.gx1
.gx2
.gx4
.gx6
.gx8
.gx12
.gx16
.gx24
.gx32
.gx48
.gx64
## Row gap[](#row-gap)
Spacing can be set on just the y-axis with `.gy` classes. They can be used independently or in combination with other atomic gap classes.
Class
Output
Definition
Responsive?
`.gy0`
column-gap: 0
Add no space between rows
Yes
`.gy1`
column-gap: 1px
Space out rows by 1px
Yes
`.gy2`
column-gap: 2px
Space out rows by 2px
Yes
`.gy4`
column-gap: 4px
Space out rows by 4px
Yes
`.gy6`
column-gap: 6px
Space out rows by 6px
Yes
`.gy8`
column-gap: 8px
Space out rows by 8px
Yes
`.gy12`
column-gap: 12px
Space out rows by 12px
Yes
`.gy16`
column-gap: 16px
Space out rows by 16px
Yes
`.gy24`
column-gap: 24px
Space out rows by 24px
Yes
`.gy32`
column-gap: 32px
Space out rows by 32px
Yes
`.gy48`
column-gap: 48px
Space out rows by 48px
Yes
`.gy64`
column-gap: 64px
Space out rows by 64px
Yes
### Row examples[](#row-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
```
.gy0
.gy1
.gy2
.gy4
.gy6
.gy8
.gy12
.gy16
.gy24
.gy32
.gy48
.gy64
---
### Page: Grid
URL: https://stackoverflow.design/system/base/grid
Date: 2026-08-13T14:42:33.178Z
description: Atomic CSS grid classes allow you to quickly add native css grids to your container.
Content:
## Overview[](#overview)
CSS Grids are the most powerful layout system available in CSS. It has two dimensions, meaning it can handle both columns and rows simultaneously, unlike [flex layouts](/product/base/flex) which can only do one at a time. Applying `.d-grid` to a container will lay out its children according to the CSS Grid layout spec. Adding atomic modifying classes will change the layout’s behavior. Applying classes to an individual `.grid--item` will change that cell’s behavior.
### Examples[](#examples)
```html
…
```
.grid--item
.grid--col-all
.grid--item
.grid--col1
.grid--row2
.grid--item
.grid--col3
.grid\_\_2
.grid--item
.grid--item
.grid--item
.grid--item
.grid--item
.grid--col2
.grid--item
.grid--col1
.grid--item
.grid--col-all
## Columns[](#columns)
To define a discrete number of columns in your grid layout, you can add a `grid__[x]` modifying class.
### Column classes[](#column-classes)
Class
Output
Definition
Responsive?
`.grid__1`
grid-template-columns: repeat(1, minmax(0, 1fr))
Creates a grid layout with 1 column
Yes
`.grid__2`
grid-template-columns: repeat(2, minmax(0, 2fr))
Creates a grid layout with 2 columns
Yes
`.grid__3`
grid-template-columns: repeat(3, minmax(0, 3fr))
Creates a grid layout with 3 columns
Yes
`.grid__4`
grid-template-columns: repeat(4, minmax(0, 4fr))
Creates a grid layout with 4 columns
Yes
`.grid__5`
grid-template-columns: repeat(5, minmax(0, 5fr))
Creates a grid layout with 5 columns
Yes
`.grid__6`
grid-template-columns: repeat(6, minmax(0, 6fr))
Creates a grid layout with 6 columns
Yes
`.grid__7`
grid-template-columns: repeat(7, minmax(0, 7fr))
Creates a grid layout with 7 columns
Yes
`.grid__8`
grid-template-columns: repeat(8, minmax(0, 8fr))
Creates a grid layout with 8 columns
Yes
`.grid__9`
grid-template-columns: repeat(9, minmax(0, 9fr))
Creates a grid layout with 9 columns
Yes
`.grid__10`
grid-template-columns: repeat(10, minmax(0, 10fr))
Creates a grid layout with 10 columns
Yes
`.grid__11`
grid-template-columns: repeat(11, minmax(0, 11fr))
Creates a grid layout with 11 columns
Yes
`.grid__12`
grid-template-columns: repeat(1, minmax(0, 12fr))
Creates a grid layout with 12 columns
Yes
`.grid__auto`
grid-template-columns: auto 1fr
Creates a grid layout with auto-sized columns based on their content
Yes
### Columns examples[](#columns-examples)
```html
```
.grid--col2
.grid--row4
.grid--col2
.grid--col2
.grid--col2
.grid--col2
## Autoflow[](#autoflow)
If you have grid items that you don’t explicitly place on the grid, the auto-placement algorithm kicks in to automatically place the items.
### Autoflow classes[](#autoflow-classes)
Class
Output
Definition
Responsive?
`.g-af-row`
grid-auto-flow: row
Items are placed by filling each row in turn, adding new rows as necessary. The default.
Yes
`.g-af-column`
grid-auto-flow: column
Items are placed by filling each column in turn, adding new columns as necessary.
Yes
`.g-af-dense`
grid-auto-flow: dense
Dense packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. This may cause items to appear out-of-order, when doing so would fill in holes left by larger items.
Yes
### Autoflow examples[](#autoflow-examples)
```html
…
…
…
```
.g-af-row
1
2
3
.g-af-column
1
2
3
4
5
6
7
8
9
10
11
12
.g-af-dense
1
2
3
4
5
6
7
8
9
10
11
12
## Start and end[](#start-and-end)
If you’d like to offset a column or row and specify its start and end positioning classes, you can apply these atomic classes.
### Column start and end classes[](#column-start-and-end-classes)
Class
Output
Definition
Responsive?
`.grid--col-start1`
grid-column-start: 1
Start at the 1st column
Yes
`.grid--col-start2`
grid-column-start: 2
Start at the 2nd column
Yes
`.grid--col-start3`
grid-column-start: 3
Start at the 3rd column
Yes
`.grid--col-start4`
grid-column-start: 4
Start at the 4th column
Yes
`.grid--col-start5`
grid-column-start: 5
Start at the 5th column
Yes
`.grid--col-start6`
grid-column-start: 6
Start at the 6th column
Yes
`.grid--col-start7`
grid-column-start: 7
Start at the 7th column
Yes
`.grid--col-start8`
grid-column-start: 8
Start at the 8th column
Yes
`.grid--col-start9`
grid-column-start: 9
Start at the 9th column
Yes
`.grid--col-start10`
grid-column-start: 10
Start at the 10th column
Yes
`.grid--col-start11`
grid-column-start: 11
Start at the 11th column
Yes
`.grid--col-start12`
grid-column-start: 12
Start at the 12th column
Yes
`.grid--col-end2`
grid-column-end: 2
End at the start of 2nd column
Yes
`.grid--col-end3`
grid-column-end: 3
End at the start of 3rd column
Yes
`.grid--col-end4`
grid-column-end: 4
End at the start of 4th column
Yes
`.grid--col-end5`
grid-column-end: 5
End at the start of 5th column
Yes
`.grid--col-end6`
grid-column-end: 6
End at the start of 6th column
Yes
`.grid--col-end7`
grid-column-end: 7
End at the start of 7th column
Yes
`.grid--col-end8`
grid-column-end: 8
End at the start of 8th column
Yes
`.grid--col-end9`
grid-column-end: 9
End at the start of 9th column
Yes
`.grid--col-end10`
grid-column-end: 10
End at the start of 10th column
Yes
`.grid--col-end11`
grid-column-end: 11
End at the start of 11th column
Yes
`.grid--col-end12`
grid-column-end: 12
End at the start of 12th column
Yes
`.grid--col-end13`
grid-column-end: 13
End at the start of 13th column
Yes
Show All Classes
### Column start and end examples[](#column-start-and-end-examples)
```html
…
…
…
```
.grid--col-start1 .grid--col-end4
.grid--col-start2 .grid--col-end4
.grid--col2 .grid--col-end5
### Row start and end classes[](#row-start-and-end-classes)
Class
Output
Definition
Responsive?
`.grid--row-start1`
grid-row-start: 1
Start at the 1st row
Yes
`.grid--row-start2`
grid-row-start: 2
Start at the 2nd row
Yes
`.grid--row-start3`
grid-row-start: 3
Start at the 3rd row
Yes
`.grid--row-start4`
grid-row-start: 4
Start at the 4th row
Yes
`.grid--row-start5`
grid-row-start: 5
Start at the 5th row
Yes
`.grid--row-start6`
grid-row-start: 6
Start at the 6th row
Yes
`.grid--row-start7`
grid-row-start: 7
Start at the 7th row
Yes
`.grid--row-start8`
grid-row-start: 8
Start at the 8th row
Yes
`.grid--row-start9`
grid-row-start: 9
Start at the 9th row
Yes
`.grid--row-start10`
grid-row-start: 10
Start at the 10th row
Yes
`.grid--row-start11`
grid-row-start: 11
Start at the 11th row
Yes
`.grid--row-start12`
grid-row-start: 12
Start at the 12th row
Yes
`.grid--row-end2`
grid-row-end: 2
End at the start of 2nd row
Yes
`.grid--row-end3`
grid-row-end: 3
End at the start of 3rd row
Yes
`.grid--row-end4`
grid-row-end: 4
End at the start of 4th row
Yes
`.grid--row-end5`
grid-row-end: 5
End at the start of 5th row
Yes
`.grid--row-end6`
grid-row-end: 6
End at the start of 6th row
Yes
`.grid--row-end7`
grid-row-end: 7
End at the start of 7th row
Yes
`.grid--row-end8`
grid-row-end: 8
End at the start of 8th row
Yes
`.grid--row-end9`
grid-row-end: 9
End at the start of 9th row
Yes
`.grid--row-end10`
grid-row-end: 10
End at the start of 10th row
Yes
`.grid--row-end11`
grid-row-end: 11
End at the start of 11th row
Yes
`.grid--row-end12`
grid-row-end: 12
End at the start of 12th row
Yes
`.grid--row-end13`
grid-row-end: 13
End at the start of 13th row
Yes
Show All Classes
### Row start and end examples[](#row-start-and-end-examples)
```html
…
…
…
…
…
```
.grid--col2
.grid--row-start2
.grid--row-end4
.grid--col2
.grid--col2
.grid--col2
.grid--col2
## Alignment[](#alignment)
On the grid container, you can apply `align-items` to the y axis and `justify-items` to the x axis. On individual items, you can apply `align-self` on the y axis, and `justify-self` on the x axis.
### Alignment classes[](#alignment-classes)
Class
Output
Definition
Responsive?
`.ji-auto`
justify-items: auto
Use the parent's justify value.
Yes
`.ji-center`
justify-items: center
The items are packed flush to each other toward the center of x axis.
Yes
`.ji-start`
justify-items: start
The items are packed flush to each other toward the left.
Yes
`.ji-end`
justify-items: end
The items are packed flush to each other toward the right.
Yes
`.ji-stretch`
justify-items: stretch
Items stretch to fill the available space
Yes
`.ji-unset`
justify-items: unset
Removes any justification, effectively resetting the value
Yes
`.js-auto`
justify-self: auto
Use the parent's justify value.
Yes
`.js-center`
justify-self: center
The item is packed flush to the others toward the center of x axis.
Yes
`.js-start`
justify-self: start
The item is packed flush to the others toward the left.
Yes
`.js-end`
justify-self: end
The item is packed flush to the others toward the right.
Yes
`.js-stretch`
justify-self: stretch
Item stretches to fill the available space
Yes
`.js-unset`
justify-self: unset
Removes any justification, effectively resetting the value
Yes
`.ai-baseline`
align-items: baseline
Aligns items along the baseline of a parent's cross axis.
Yes
`.ai-center`
align-items: center
Centers child elements along the parent's cross axis.
Yes
`.ai-end`
align-items: end
Places child elements at the end of the parent's cross axis.
Yes
`.ai-start`
align-items: start
Places child elements at the start of the parent's cross axis.
Yes
`.ai-stretch`
align-items: stretch
Stretches child elements along the parent's cross axis.
Yes
`.as-auto`
align-self: auto;
Auto re-aligns a child element along the parent's main axis.
Yes
`.as-baseline`
align-self: baseline;
Re-aligns a child element along the baseline of the parent's main axis.
Yes
`.as-center`
align-self: center;
Centers a child element along the parent's main axis.
Yes
`.as-end`
align-self: end;
Re-aligns a child element to the end of the parent's main axis.
Yes
`.as-start`
align-self: start;
Re-aligns a child element to the start of the parent's main axis.
Yes
`.as-stretch`
align-self: stretch;
Stretches a child element along the parent's main axis.
Yes
Show All Classes
### Alignment examples[](#alignment-examples)
```html
…
…
…
…
```
Default
1
2
3
4
5
6
.ji-center .ai-center
1 .as-start
2
3 .as-stretch
4 .js-end
5
6
---
### Page: Height
URL: https://stackoverflow.design/system/base/height
Date: 2026-08-13T14:42:33.249Z
description: Stacks provides atomic sizing classes for heights using pixel, rem, and percentage values. Most height classes are based on a 16px base font size and will scale based on the browser's font size.
Content:
## Pixel height[](#pixel-height)
Pixel height classes allow you to set the height of an element to a specific pixel value.
### Pixel height classes[](#pixel-height-classes)
Class
Output
rem value
`.h0`
height: 0px;
0rem
`.h1`
height: 1px;
0.063rem
`.h2`
height: 2px;
0.125rem
`.h4`
height: 4px;
0.25rem
`.h6`
height: 6px;
0.375rem
`.h8`
height: 8px;
0.5rem
`.h12`
height: 12px;
0.75rem
`.h16`
height: 16px;
1rem
`.h24`
height: 24px;
1.5rem
`.h32`
height: 32px;
2rem
`.h48`
height: 48px;
3rem
`.h64`
height: 64px;
4rem
`.h96`
height: 96px;
6rem
`.h128`
height: 128px;
8rem
Show All Classes
### Base height examples[](#base-height-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
```
.h2
.h4
.h6
.h8
.h12
.h16
.h24
.h32
.h48
.h64
.h96
.h128
## Sizing units height[](#sizing-units-height)
Sizing units height classes allow you to set the height of an element according to a predefined set of 12 common values in used in Stacks.
### Sizing units height classes[](#sizing-units-height-classes)
Class
Output
rem value
`.hs1`
height: 128px;
8rem
`.hs2`
height: 256px;
16rem
`.hs3`
height: 344px;
21.5rem
`.hs4`
height: 448px;
28rem
`.hs5`
height: 512px;
32rem
`.hs6`
height: 640px;
40rem
`.hs7`
height: 768px;
48rem
`.hs8`
height: 848px;
53rem
`.hs9`
height: 960px;
60rem
`.hs10`
height: 1024px;
64rem
`.hs11`
height: 1120px;
70rem
`.hs12`
height: 1280px;
80rem
### Sizing units height examples[](#sizing-units-height-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
```
.hs1
.hs2
.hs3
.hs4
.hs5
.hs6
.hs7
.hs8
.hs9
.hs10
.hs11
.hs12
## Fluid height[](#fluid-height)
Fluid height classes allow you to set the height of an element to a percentage of the parent element’s height or to the full height of the viewport.
### Fluid height classes[](#fluid-height-classes)
Class
Output
Responsive?
`.h100`
height: 100%;
Yes
`.h-screen`
height: 100vh;
Yes
`.h-auto`
height: auto;
Yes
### Fluid height examples[](#fluid-height-examples)
```html
…
```
.h100
## Min height[](#min-height)
Min height classes allow you to set the minimum height of an element.
### Min height classes[](#min-height-classes)
Class
Output
rem value
Responsive?
`.hmn0`
min-height: 0;
\-
Yes
`.hmn1`
min-height: 128px;
8rem
`.hmn2`
min-height: 256px;
16rem
`.hmn3`
min-height: 344px;
21.5rem
`.hmn4`
min-height: 448px;
28rem
`.hmn5`
min-height: 512px;
32rem
`.hmn6`
min-height: 640px;
40rem
`.hmn7`
min-height: 768px;
48rem
`.hmn8`
min-height: 848px;
53rem
`.hmn9`
min-height: 960px;
60rem
`.hmn10`
min-height: 1024px;
64rem
`.hmn11`
min-height: 1120px;
70rem
`.hmn12`
min-height: 1280px;
80rem
`.hmn100`
min-height: 100%;
\-
Yes
`.hmn-screen`
min-height: 100vh;
\-
Yes
`.hmn-initial`
min-height: initial;
\-
Yes
Show All Classes
## Max height[](#max-height)
Max height classes allow you to set the maximum height of an element.
### Max height classes[](#max-height-classes)
Class
Output
rem value
Responsive?
`.hmx1`
max-height: 128px;
8rem
`.hmx2`
max-height: 256px;
16rem
`.hmx3`
max-height: 344px;
21.5rem
`.hmx4`
max-height: 448px;
28rem
`.hmx5`
max-height: 512px;
32rem
`.hmx6`
max-height: 640px;
40rem
`.hmx7`
max-height: 768px;
48rem
`.hmx8`
max-height: 848px;
53rem
`.hmx9`
max-height: 960px;
60rem
`.hmx10`
max-height: 1024px;
64rem
`.hmx11`
max-height: 1120px;
70rem
`.hmx12`
max-height: 1280px;
80rem
`.hmx100`
max-height: 100%;
\-
Yes
`.hmx-screen`
max-height: 100vh;
\-
Yes
`.hmx-initial`
max-height: initial;
\-
Yes
Show All Classes
---
### Page: Interactivity
URL: https://stackoverflow.design/system/base/interactivity
Date: 2026-08-13T14:42:33.296Z
description: Atomic interactivity classes allow you to quickly change an element's interactivity.
Content:
## Pointer events[](#pointer-events)
The pointer-events CSS property enables or disables all mouse events on an element.
### Classes[](#classes)
Class
Output
Definition
`.pe-auto`
pointer-events: auto;
The element behaves as it would if the pointer-events property were not specified.
`.pe-none`
pointer-events: none;
Disables mouse events (clicking, dragging, hovering, etc.) on the element and its decendents.
### Examples[](#examples)
```html
…
…
```
.pe-auto .pe-none
## Focus[](#focus)
The focus utility classes allow you to apply custom focus styles to an element. Add the conditional prefix `f:` to only apply the style when the element is focused.
### Classes[](#classes-1)
Class
Definition
`.focus`
The element will have the default Stacks focus style applied.
`.focus-inset`
The element will have the inset Stacks focus style applied.
`.focus-bordered`
The element will have the default Stacks focus style applied and match the border to the focus style.
`.focus-inset-bordered`
The element will have the inset Stacks focus style applied and match the border to the focus style.
### Examples[](#examples-1)
```html
…
…
…
…
```
.focus
.focus-inset
.focus-bordered
.focus-inset-bordered
### Conditional focus examples[](#conditional-focus-examples)
Add the conditional prefix `f:` to only apply the style when the element is focused.
```html
…
…
…
…
```
.f:focus
.f:focus-inset
.f:focus-bordered
.f:focus-inset-bordered
## User select[](#user-select)
The user-select CSS property controls whether the user can select text.
### Classes[](#classes-2)
Class
Output
Definition
`.us-auto`
user-select: auto;
The element behaves as it would if the user-select property were not specified.
`.us-none`
user-select: none;
The text of the element and its sub-elements is not selectable. It may be appropriate to combine with \`.c-default\`
### Examples[](#examples-2)
```html
…
…
```
.us-auto
.us-none
---
### Page: Lists
URL: https://stackoverflow.design/system/base/lists
Date: 2026-08-13T14:42:33.309Z
description: Stacks provides a few atomic classes to help style lists.
Content:
## Classes[](#classes)
Class
Output
`.list-reset`
list-style: none; margin: 0; padding: 0;
`.list-ls-none`
list-style: none;
`.list-ls-disc`
list-style-type: disc;
`.list-ls-decimal`
list-style-type: decimal;
`.list-ls-unset`
list-style-type: inherit;
`.list-inside`
list-style-position: inside;
`.list-outside`
list-style-position: outside;
## Examples[](#examples)
By design, our lists inherit some sensible margins by default. However, in some layouts, you may want to strip these default margins by adding `.list-reset` and then explicitly choosing a list style and list style position. These classes can be applied to ordered and unordered lists interchangably, though if you’re wanting to show decimals, it’s most appropriate to mark your list up as an ordered list.
### List Style[](#list-style)
```html
…
…
…
…
```
1. List item 1
2. List item 2
3. List item 3
4. List item 4
5. List item 5
* List item 1
* List item 2
* List item 3
* List item 4
* List item 5
* List item 1
* List item 2
* List item 3
* List item 4
* List item 5
1. List item 1
2. List item 2
3. List item 3
4. List item 4
5. List item 5
### List Position[](#list-position)
By default, the position of markers in a list item are outside their containing element.
```html
…
…
```
* List item 1
* List item 2
* List item 3
* List item 4
* List item 5
* List item 1
* List item 2
* List item 3
* List item 4
* List item 5
---
### Page: Margin
URL: https://stackoverflow.design/system/base/margin
Date: 2026-08-13T14:42:33.313Z
description: Stacks provides atomic classes to override margin.
Content:
## Base[](#base)
Immutable margin utilities are based on our global white space scale. These can dramatically help reduce the size of large stylesheets and allow for greater flexibility and quicker iteration when designing in the browser.
### Abbreviations[](#abbreviations)
Abbreviation
Property
Responsive?
`m`
margin
Yes
`mt`
margin-top
Yes
`mr`
margin-right
Yes
`mb`
margin-bottom
Yes
`ml`
margin-left
Yes
`mx`
margin x-axis
Yes
`my`
margin y-axis
Yes
### Base examples[](#base-examples)
```html
```
Example div with different margins applied
### Negative classes[](#negative-classes)
Class
Output
`.mn1`
margin: -1px
`.mn2`
margin: -2px
`.mn4`
margin: -4px
`.mn6`
margin: -6px
`.mn8`
margin: -8px
`.mn12`
margin: -12px
`.mn16`
margin: -16px
`.mn24`
margin: -24px
`.mn32`
margin: -32px
`.mn48`
margin: -48px
`.mn64`
margin: -64px
`.mn96`
margin: -96px
`.mn128`
margin: -128px
`.mn50`
margin: -50%
`.mn100`
margin: -100%
`.mtn1`
margin-top: -1px
`.mtn2`
margin-top: -2px
`.mtn4`
margin-top: -4px
`.mtn6`
margin-top: -6px
`.mtn8`
margin-top: -8px
`.mtn12`
margin-top: -12px
`.mtn16`
margin-top: -16px
`.mtn24`
margin-top: -24px
`.mtn32`
margin-top: -32px
`.mtn48`
margin-top: -48px
`.mtn64`
margin-top: -64px
`.mtn96`
margin-top: -96px
`.mtn128`
margin-top: -128px
`.mtn50`
margin-top: -50%
`.mtn100`
margin-top: -100%
`.mrn1`
margin-right: -1px
`.mrn2`
margin-right: -2px
`.mrn4`
margin-right: -4px
`.mrn6`
margin-right: -6px
`.mrn8`
margin-right: -8px
`.mrn12`
margin-right: -12px
`.mrn16`
margin-right: -16px
`.mrn24`
margin-right: -24px
`.mrn32`
margin-right: -32px
`.mrn48`
margin-right: -48px
`.mrn64`
margin-right: -64px
`.mrn96`
margin-right: -96px
`.mrn128`
margin-right: -128px
`.mrn50`
margin-right: -50%
`.mrn100`
margin-right: -100%
`.mbn1`
margin-bottom: -1px
`.mbn2`
margin-bottom: -2px
`.mbn4`
margin-bottom: -4px
`.mbn6`
margin-bottom: -6px
`.mbn8`
margin-bottom: -8px
`.mbn12`
margin-bottom: -12px
`.mbn16`
margin-bottom: -16px
`.mbn24`
margin-bottom: -24px
`.mbn32`
margin-bottom: -32px
`.mbn48`
margin-bottom: -48px
`.mbn64`
margin-bottom: -64px
`.mbn96`
margin-bottom: -96px
`.mbn128`
margin-bottom: -128px
`.mbn50`
margin-bottom: -50%
`.mbn100`
margin-bottom: -100%
`.mln1`
margin-left: -1px
`.mln2`
margin-left: -2px
`.mln4`
margin-left: -4px
`.mln6`
margin-left: -6px
`.mln8`
margin-left: -8px
`.mln12`
margin-left: -12px
`.mln16`
margin-left: -16px
`.mln24`
margin-left: -24px
`.mln32`
margin-left: -32px
`.mln48`
margin-left: -48px
`.mln64`
margin-left: -64px
`.mln96`
margin-left: -96px
`.mln128`
margin-left: -128px
`.mln50`
margin-left: -50%
`.mln100`
margin-left: -100%
`.mxn1`
margin-left: -1px; margin-right: -1px
`.mxn2`
margin-left: -2px; margin-right: -2px
`.mxn4`
margin-left: -4px; margin-right: -4px
`.mxn6`
margin-left: -6px; margin-right: -6px
`.mxn8`
margin-left: -8px; margin-right: -8px
`.mxn12`
margin-left: -12px; margin-right: -12px
`.mxn16`
margin-left: -16px; margin-right: -16px
`.mxn24`
margin-left: -24px; margin-right: -24px
`.mxn32`
margin-left: -32px; margin-right: -32px
`.mxn48`
margin-left: -48px; margin-right: -48px
`.mxn64`
margin-left: -64px; margin-right: -64px
`.mxn96`
margin-left: -96px; margin-right: -96px
`.mxn128`
margin-left: -128px; margin-right: -128px
`.mxn50`
margin-left: -50%; margin-right: -50%
`.mxn100`
margin-left: -100%; margin-right: -100%
`.myn1`
margin-top: -1px; margin-bottom: -1px
`.myn2`
margin-top: -2px; margin-bottom: -2px
`.myn4`
margin-top: -4px; margin-bottom: -4px
`.myn6`
margin-top: -6px; margin-bottom: -6px
`.myn8`
margin-top: -8px; margin-bottom: -8px
`.myn12`
margin-top: -12px; margin-bottom: -12px
`.myn16`
margin-top: -16px; margin-bottom: -16px
`.myn24`
margin-top: -24px; margin-bottom: -24px
`.myn32`
margin-top: -32px; margin-bottom: -32px
`.myn48`
margin-top: -48px; margin-bottom: -48px
`.myn64`
margin-top: -64px; margin-bottom: -64px
`.myn96`
margin-top: -96px; margin-bottom: -96px
`.myn128`
margin-top: -128px; margin-bottom: -128px
`.myn50`
margin-top: -50%; margin-bottom: -50%
`.myn100`
margin-top: -100%; margin-bottom: -100%
Show All Classes
## Auto[](#auto)
Stacks provides additional automatic margin classes. These come in handy when positioning individual flex items within flex layouts, or horizontally centering a block-level element.
### Auto classes[](#auto-classes)
Class
Output
`.m-auto`
margin: auto
`.mt-auto`
margin-top: auto
`.mr-auto`
margin-right: auto
`.mb-auto`
margin-bottom: auto
`.ml-auto`
margin-left: auto
`.mx-auto`
margin-left: auto; margin-right: auto
`.my-auto`
margin-top: auto; margin-bottom: auto
---
### Page: Object fit
URL: https://stackoverflow.design/system/base/object-fit
Date: 2026-08-13T14:42:33.353Z
description: Atomic classes that control the sizing of an img or video relative to its container.
Content:
## Classes[](#classes)
Class
Output
Definition
`.of-contain`
object-fit: contain
Fit the content to the content box while preserving its aspect ratio. This may result in empty space in the content box.
`.of-cover`
object-fit: cover
Cover the entire content box with the content while preserving its aspect ratio. This may crop the content.
`.of-fill`
object-fit: fill
Stretch and scale the content's dimensions to match its content box. This is the default browser value.
`.of-none`
object-fit: none
Prevent the content from being resized.
`.of-scale-down`
object-fit: scale-down
When larger than the content box, resize the content to fill its content box. Otherwise, maintain the content's original dimensions.
`.op-center`
object-position: center
Center the content within its content box.
## Examples[](#examples)
```html
```
.of-contain
 
.of-cover
 
.of-fill
 
.of-none
 
.of-scale-down
 
.op-center.of-none
 
---
### Page: Opacity
URL: https://stackoverflow.design/system/base/opacity
Date: 2026-08-13T14:42:33.356Z
description: Atomic opacity classes allow you to change an element's opacity quickly.
Content:
## Classes[](#classes)
Class
Output
Hover?
Focus?
`.o0`
opacity: 0
Yes
`.o5`
opacity: 0.05
Yes
`.o10`
opacity: 0.1
`.o20`
opacity: 0.2
`.o30`
opacity: 0.3
`.o40`
opacity: 0.4
`.o50`
opacity: 0.5
Yes
`.o60`
opacity: 0.6
`.o70`
opacity: 0.7
`.o80`
opacity: 0.8
Yes
`.o90`
opacity: 0.9
`.o100`
opacity: 1
Yes
Yes
## Examples[](#examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
```
.o0
.o5
.o10
.o20
.o30
.o40
.o50
.o60
.o70
.o80
.o90
.o100
---
### Page: Outline
URL: https://stackoverflow.design/system/base/outline
Date: 2026-08-13T14:42:33.368Z
description: Atomic outline classes allow you to quickly change an element's outline styling.
Content:
Warning
**Warning:** `.outline-ring` does not meet our accessibility standards for focus state styling and should be used for decorative purposes only.
## Classes[](#classes)
Class
Output
Definition
`.outline-none`
outline: 0;
Removes the browser's default focus style. To maintain accessibility, care should be taken to replace the style that's been removed.
`.outline-ring`
outline: solid var(--su4) var(--translucent-secondary);
Adds an outline using our translucent secondary color.
## Examples[](#examples)
```html
…
…
```
.outline-none
.outline-ring
---
### Page: Overflow
URL: https://stackoverflow.design/system/base/overflow
Date: 2026-08-13T14:42:33.370Z
description: Atomic overflow classes allow you to change an element's overflow properties quickly.
Content:
## Classes[](#classes)
Class
Output
Definition
`.overflow-auto`
overflow: auto;
If content fits inside the content box, it looks the same as visible, but still establishes a new block-formatting context. Desktop browsers like Firefox provide scrollbars if content overflows.
`.overflow-x-auto`
overflow-x: auto;
If content fits inside the content box, it looks the same as visible in the x dimension, but still establishes a new block-formatting context. Desktop browsers like Firefox provide scrollbars if content overflows.
`.overflow-y-auto`
overflow-y: auto;
If content fits inside the content box, it looks the same as visible in the y dimension, but still establishes a new block-formatting context. Desktop browsers like Firefox provide scrollbars if content overflows.
`.overflow-hidden`
overflow: hidden;
Content is clipped if necessary to fit the content box. No scrollbars are provided.
`.overflow-x-hidden`
overflow-x: hidden;
Content is clipped if necessary to fit the content box. No scrollbars are provided in the x dimension.
`.overflow-y-hidden`
overflow-y: hidden;
Content is clipped if necessary to fit the content box. No scrollbars are provided in the y dimension.
`.overflow-scroll`
overflow: scroll;
Content is clipped if necessary to fit the content box. Browsers display scrollbars whether or not any content is actually clipped. (This prevents scrollbars from appearing or disappearing when the content changes.) Printers may still print overflowing content.
`.overflow-x-scroll`
overflow-x: scroll;
Content is clipped if necessary to fit the content box. Browsers display scrollbars whether or not any content is actually clipped in the x dimension.
`.overflow-y-scroll`
overflow-y: scroll;
Content is clipped if necessary to fit the content box. Browsers display scrollbars whether or not any content is actually clipped in the y dimension.
`.overflow-visible`
overflow: visible;
Content is not clipped and may be rendered outside the content box. This is the default value.
## Examples[](#examples)
```html
…
…
…
…
…
…
…
…
…
…
```
.overflow-auto
.overflow-x-auto
.overflow-y-auto
.overflow-hidden
.overflow-x-hidden
.overflow-y-hidden
.overflow-scroll
.overflow-x-scroll
.overflow-y-scroll
.overflow-visible
---
### Page: Padding
URL: https://stackoverflow.design/system/base/padding
Date: 2026-08-13T14:42:33.374Z
description: Stacks provides atomic classes to override padding.
Content:
## Padding[](#padding)
Immutable padding utilities are based on a global white space scale defined with custom properties. These can dramatically help reduce the size of large stylesheets and allow for greater flexibility and quicker iteration when designing in the browser.
Padding should never be declared outside of these utilities. This is meant to help create consistency and avoid magic numbers. If, for some reason, the default white space scale does not suit your design, customize and extend it before use.
### Padding class abbreviations[](#padding-class-abbreviations)
Abbreviation
Property
Responsive?
`p`
padding
Yes
`pt`
padding-top
Yes
`pr`
padding-right
Yes
`pb`
padding-bottom
Yes
`pl`
padding-left
Yes
`px`
padding x-axis
Yes
`py`
padding y-axis
Yes
### Padding classes[](#padding-classes)
```html
…
```
Example div with different paddings applied
Class
Output
Responsive?
`.p0`
padding: 0
Yes
`.p1`
padding: 1px
Yes
`.p2`
padding: 2px
Yes
`.p4`
padding: 4px
Yes
`.p6`
padding: 6px
Yes
`.p8`
padding: 8px
Yes
`.p12`
padding: 12px
Yes
`.p16`
padding: 16px
Yes
`.p24`
padding: 24px
Yes
`.p32`
padding: 32px
Yes
`.p48`
padding: 48px
Yes
`.p64`
padding: 64px
Yes
`.p96`
padding: 96px
Yes
`.p128`
padding: 128px
Yes
`.p50`
padding: 50%
Yes
`.p100`
padding: 100%
Yes
`.pt0`
padding-top: 0
Yes
`.pt1`
padding-top: 1px
Yes
`.pt2`
padding-top: 2px
Yes
`.pt4`
padding-top: 4px
Yes
`.pt6`
padding-top: 6px
Yes
`.pt8`
padding-top: 8px
Yes
`.pt12`
padding-top: 12px
Yes
`.pt16`
padding-top: 16px
Yes
`.pt24`
padding-top: 24px
Yes
`.pt32`
padding-top: 32px
Yes
`.pt48`
padding-top: 48px
Yes
`.pt64`
padding-top: 64px
Yes
`.pt96`
padding-top: 96px
Yes
`.pt128`
padding-top: 128px
Yes
`.pt50`
padding-top: 50%
Yes
`.pt100`
padding-top: 100%
Yes
`.pr0`
padding-right: 0
Yes
`.pr1`
padding-right: 1px
Yes
`.pr2`
padding-right: 2px
Yes
`.pr4`
padding-right: 4px
Yes
`.pr6`
padding-right: 6px
Yes
`.pr8`
padding-right: 8px
Yes
`.pr12`
padding-right: 12px
Yes
`.pr16`
padding-right: 16px
Yes
`.pr24`
padding-right: 24px
Yes
`.pr32`
padding-right: 32px
Yes
`.pr48`
padding-right: 48px
Yes
`.pr64`
padding-right: 64px
Yes
`.pr96`
padding-right: 96px
Yes
`.pr128`
padding-right: 128px
Yes
`.pr50`
padding-right: 50%
Yes
`.pr100`
padding-right: 100%
Yes
`.pb0`
padding-bottom: 0
Yes
`.pb1`
padding-bottom: 1px
Yes
`.pb2`
padding-bottom: 2px
Yes
`.pb4`
padding-bottom: 4px
Yes
`.pb6`
padding-bottom: 6px
Yes
`.pb8`
padding-bottom: 8px
Yes
`.pb12`
padding-bottom: 12px
Yes
`.pb16`
padding-bottom: 16px
Yes
`.pb24`
padding-bottom: 24px
Yes
`.pb32`
padding-bottom: 32px
Yes
`.pb48`
padding-bottom: 48px
Yes
`.pb64`
padding-bottom: 64px
Yes
`.pb96`
padding-bottom: 96px
Yes
`.pb128`
padding-bottom: 128px
Yes
`.pb50`
padding-bottom: 50%
Yes
`.pb100`
padding-bottom: 100%
Yes
`.pl0`
padding-left: 0
Yes
`.pl1`
padding-left: 1px
Yes
`.pl2`
padding-left: 2px
Yes
`.pl4`
padding-left: 4px
Yes
`.pl6`
padding-left: 6px
Yes
`.pl8`
padding-left: 8px
Yes
`.pl12`
padding-left: 12px
Yes
`.pl16`
padding-left: 16px
Yes
`.pl24`
padding-left: 24px
Yes
`.pl32`
padding-left: 32px
Yes
`.pl48`
padding-left: 48px
Yes
`.pl64`
padding-left: 64px
Yes
`.pl96`
padding-left: 96px
Yes
`.pl128`
padding-left: 128px
Yes
`.pl50`
padding-left: 50%
Yes
`.pl100`
padding-left: 100%
Yes
`.px1`
padding-left: 1px; padding-right: 1px
Yes
`.px2`
padding-left: 2px; padding-right: 2px
Yes
`.px4`
padding-left: 4px; padding-right: 4px
Yes
`.px6`
padding-left: 6px; padding-right: 6px
Yes
`.px8`
padding-left: 8px; padding-right: 8px
Yes
`.px12`
padding-left: 12px; padding-right: 12px
Yes
`.px16`
padding-left: 16px; padding-right: 16px
Yes
`.px24`
padding-left: 24px; padding-right: 24px
Yes
`.px32`
padding-left: 32px; padding-right: 32px
Yes
`.px48`
padding-left: 48px; padding-right: 48px
Yes
`.px64`
padding-left: 64px; padding-right: 64px
Yes
`.px96`
padding-left: 96px; padding-right: 96px
Yes
`.px128`
padding-left: 128px; padding-right: 128px
Yes
`.py1`
padding-top: 1px; padding-bottom: 1px
Yes
`.py2`
padding-top: 2px; padding-bottom: 2px
Yes
`.py4`
padding-top: 4px; padding-bottom: 4px
Yes
`.py6`
padding-top: 6px; padding-bottom: 6px
Yes
`.py8`
padding-top: 8px; padding-bottom: 8px
Yes
`.py12`
padding-top: 12px; padding-bottom: 12px
Yes
`.py16`
padding-top: 16px; padding-bottom: 16px
Yes
`.py24`
padding-top: 24px; padding-bottom: 24px
Yes
`.py32`
padding-top: 32px; padding-bottom: 32px
Yes
`.py48`
padding-top: 48px; padding-bottom: 48px
Yes
`.py64`
padding-top: 64px; padding-bottom: 64px
Yes
`.py96`
padding-top: 96px; padding-bottom: 96px
Yes
`.py128`
padding-top: 128px; padding-bottom: 128px
Yes
Show All Classes
---
### Page: Positioning
URL: https://stackoverflow.design/system/base/position
Date: 2026-08-13T14:42:33.428Z
description: Atomic positioning classes allow you to quickly change an element's position.
Content:
## Classes[](#classes)
Class
Output
Definition
Responsive?
`.ps-absolute`
position: absolute;
Absolutely positions an element. Typically is used in conjunction with \`top\`, \`right\`, \`bottom\`, and \`left\` properties. Note: Absolutely positioning an element takes it out of the DOM flow and puts it automatically above all relatively positioned items which don't have a \`z-index\` assigned.
Yes
`.ps-fixed`
position: fixed;
Fixes an element within the viewport. Typically is used in conjunction with \`top\`, \`right\`, \`bottom\`, and \`left\` properties. Note: Fixing an element's position, like absolute positioning, takes it out of the DOM flow and puts it automatically above all relatively positioned items.
Yes
`.ps-relative`
position: relative;
Relatively positions an element in relation to elements around it. The \`top\` and \`bottom\` properties specify the vertical offset from its normal position. In the same way the \`left\` and \`right\` properties specify the horizontal offset.
Yes
`.ps-static`
position: static;
An element is positioned according to the document's flow. The \`top\`, \`right\`, \`bottom\`, \`left\`, and \`z-index\` properties have no effect. This is the default value.
Yes
`.ps-sticky`
position: sticky;
An element is positioned according to the document's flow, and then offset relative to its flow root and containing block. This creates a new stacking context. Note: Sticky elements, by design, will not work inside an element with \`overflow:hidden;\` or \`overflow:auto;\` values.
Yes
`.ps-unset`
position: unset;
Removes previously set \`position\` value, reverting the element back to the initial browser value.
Yes
Show All Classes
## Examples[](#examples)
```html
…
…
…
…
…
…
```
**.ps-static**
**.ps-relative**
.t32
r24
**.ps-absolute**
.t48
.r32
**.ps-sticky**
.t64
## Coordinates[](#coordinates)
Our spacing units aren’t limited to margin and padding; they also apply to top, right, left, and bottom declarations. Combined with our position utility classes, you should be able to achieve absolutely-positioned layouts while adhering to Stacks’ spacing conventions.
### Coordinate classes[](#coordinate-classes)
Abbreviation
Definition
Responsive?
`t`
top
Yes
`r`
right
Yes
`b`
bottom
Yes
`l`
left
Yes
`i`
inset
Yes
`tn`
negative top
Yes
`rn`
negative right
Yes
`bn`
negative bottom
Yes
`ln`
negative left
Yes
### Coordinate examples[](#coordinate-examples)
```html
…
…
…
…
…
```
.t12 .l12
.t48 .r24
.t50 .l50
.b48 .l48
.rn8 .bn8
.i64
## Positive coordinates[](#positive-coordinates)
Prefix
0
1px
2px
4px
6px
8px
12px
16px
24px
32px
48px
64px
96px
128px
50%
100%
t
`.t0`
`.t1`
`.t2`
`.t4`
`.t6`
`.t8`
`.t12`
`.t16`
`.t24`
`.t32`
`.t48`
`.t64`
`.t96`
`.t128`
`.t50`
`.t100`
r
`.r0`
`.r1`
`.r2`
`.r4`
`.r6`
`.r8`
`.r12`
`.r16`
`.r24`
`.r32`
`.r48`
`.r64`
`.r96`
`.r128`
`.r50`
`.r100`
b
`.b0`
`.b1`
`.b2`
`.b4`
`.b6`
`.b8`
`.b12`
`.b16`
`.b24`
`.b32`
`.b48`
`.b64`
`.b96`
`.b128`
`.b50`
`.b100`
l
`.l0`
`.l1`
`.l2`
`.l4`
`.l6`
`.l8`
`.l12`
`.l16`
`.l24`
`.l32`
`.l48`
`.l64`
`.l96`
`.l128`
`.l50`
`.l100`
i
`.i0`
`.i1`
`.i2`
`.i4`
`.i6`
`.i8`
`.i12`
`.i16`
`.i24`
`.i32`
`.i48`
`.i64`
`.i96`
`.i128`
\-
\-
## Negative coordinates[](#negative-coordinates)
Prefix
\-1px
\-2px
\-4px
\-6px
\-8px
\-12px
\-16px
\-24px
\-32px
\-48px
\-64px
\-96px
\-128px
\-50%
\-100%
tn
`.tn1`
`.tn2`
`.tn4`
`.tn6`
`.tn8`
`.tn12`
`.tn16`
`.tn24`
`.tn32`
`.tn48`
`.tn64`
`.tn96`
`.tn128`
`.tn50`
`.tn100`
rn
`.rn1`
`.rn2`
`.rn4`
`.rn6`
`.rn8`
`.rn12`
`.rn16`
`.rn24`
`.rn32`
`.rn48`
`.rn64`
`.rn96`
`.rn128`
`.rn50`
`.rn100`
bn
`.bn1`
`.bn2`
`.bn4`
`.bn6`
`.bn8`
`.bn12`
`.bn16`
`.bn24`
`.bn32`
`.bn48`
`.bn64`
`.bn96`
`.bn128`
`.bn50`
`.bn100`
ln
`.ln1`
`.ln2`
`.ln4`
`.ln6`
`.ln8`
`.ln12`
`.ln16`
`.ln24`
`.ln32`
`.ln48`
`.ln64`
`.ln96`
`.ln128`
`.ln50`
`.ln100`
---
### Page: Transitions
URL: https://stackoverflow.design/system/base/transitions
Date: 2026-08-13T14:42:33.448Z
description: Atomic transition classes allow you to quickly apply transitions properties to an element. You can modify an element's transition duration, property, or delay.
Content:
You can trigger CSS transitions directly with pseudo classes like `:hover` which activate on mouse over, `:focus` which activates when user tabs onto or clicks into an input element, or `active` when a user clicks on an element.
You can also trigger a CSS transition using JavaScript by adding or removing a class.
## Classes[](#classes)
Class
Output
Definition
`.t`
transition-duration: .1s; transition-property: all; transition-timing-function: ease-in; transition-delay: 0s;
Apply a default transition style to an element.
`.t-slow`
transition-duration: .25s;
Slow down the default transition to 0.25s.
`.t-fast`
transition-duration: .05s;
Speed up the default transition to 0.05s.
`.t-unset`
transition-property: none;
Remove transition properties from an element.
`.t-bg`
transition-property: background-color;
Transition the background property of an element.
`.t-opacity`
transition-property: opacity;
Transition the opacity property of an element.
`.t-shadow`
transition-property: box-shadow;
Transition the box shadow property of an element.
`.t-delay`
transition-delay: .25s;
Apply a transition delay to an element.
`.t-delay-unset`
transition-delay: 0s;
Remove a transition delay from an element.
## Base transition[](#base-transition)
The base transition applies a default duration timing function to an element.
```html
…
```
.t
## Speed[](#speed)
Change an elements default transition duration.
```html
…
…
```
.t-slow
.t-fast
## Property[](#property)
Target a specific CSS property for transition, or remove the default transition.
```html
…
…
…
…
```
.t-unset
.t-bg
.t-opacity
.t-shadow
## Delay[](#delay)
Refers to how long you want to wait before starting the duration.
```html
…
…
```
.t-delay
.t-delay-unset
---
### Page: Truncation
URL: https://stackoverflow.design/system/base/truncation
Date: 2026-08-13T14:42:33.452Z
description: Stacks provides utility classes for various types of truncation.
Content:
## Classes[](#classes)
Class
Description
Parent
`.truncate`
Text is cropped to the width of its parent with an ellipsis.
N/A
`.v-truncate[x]`
Text is cropped to the length of \[x\] number of lines with an ellipsis.
N/A
`.v-truncate-fade`
Text is cropped by visually fading it out.
N/A
`.v-truncate-fade__sm`
Reduces the height of the visible text.
`.v-truncate-fade`
`.v-truncate-fade__lg`
Increases the amount of visible text.
`.v-truncate-fade`
## Examples[](#examples)
### Ellipses[](#ellipses)
CSS offers truncation on arbitrarily-long strings. This can help sanitize user-inputted things like bios, locations, or display names. In order for text truncation to work, it should be applied to a block-level element. Truncation can only apply to text/strings, not arbitrary block-level elements.
```html
…
…
…
…
…
…
```
Regardless of length, this text will be truncated horizontally. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will be truncated to 1 line, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will be truncated to 2 lines, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will be truncated to 3 lines, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will be truncated to 4 lines, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will be truncated to 5 lines, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
### Fade[](#fade)
Alternatively, you can use a vertical fade that will set `max-height` and sets a vertical `mask-image`:
```html
…
…
…
```
Regardless of length, this text will fade out, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will fade out, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Regardless of length, this text will fade out, vertically. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
---
### Page: Vertical alignment
URL: https://stackoverflow.design/system/base/vertical-alignment
Date: 2026-08-13T14:42:33.467Z
description: Atomic vertical alignment classes allow you to change an element's vertical alignment quickly.
Content:
## Classes[](#classes)
Class
Output
`.va-baseline`
vertical-align: baseline;
`.va-bottom`
vertical-align: bottom;
`.va-middle`
vertical-align: middle;
`.va-sub`
vertical-align: sub;
`.va-super`
vertical-align: super;
`.va-text-bottom`
vertical-align: text-bottom;
`.va-text-top`
vertical-align: text-top;
`.va-top`
vertical-align: top;
`.va-unset`
vertical-align: unset;
## Examples[](#examples)
```html
…
…
…
…
…
…
…
…
…
```
.va-baseline .va-bottom .va-middle .va-sub .va-super .va-text-bottom .va-text-top .va-top .va-unset
---
### Page: Visibility
URL: https://stackoverflow.design/system/base/visibility
Date: 2026-08-13T14:42:33.470Z
description: Atomic visibility classes allow you to quickly change an element's visibility.
Content:
## Classes[](#classes)
Class
Definition
`.v-visible`
The element visible
`.v-visible-sr`
The element is visible only to screen readers
`.v-hidden`
The element is invisible, but still affects layout as normal
## Examples[](#examples)
```html
…
…
…
```
.v-visible
.v-visible-sr
.v-hidden
---
### Page: Width
URL: https://stackoverflow.design/system/base/width
Date: 2026-08-13T14:42:33.471Z
description: Stacks provides atomic sizing classes for widths using pixel, rem, and percentage values. Most width classes are based on a 16px base font size and will scale based on the browser's font size.
Content:
## Pixel width[](#pixel-width)
Pixel width classes allow you to set the width of an element to a specific pixel value.
### Pixel width classes[](#pixel-width-classes)
Class
Output
rem value
`.w0`
width: 0px;
0rem
`.w1`
width: 1px;
0.063rem
`.w2`
width: 2px;
0.125rem
`.w4`
width: 4px;
0.25rem
`.w6`
width: 6px;
0.375rem
`.w8`
width: 8px;
0.5rem
`.w12`
width: 12px;
0.75rem
`.w16`
width: 16px;
1rem
`.w24`
width: 24px;
1.5rem
`.w32`
width: 32px;
2rem
`.w48`
width: 48px;
3rem
`.w64`
width: 64px;
4rem
`.w96`
width: 96px;
6rem
`.w128`
width: 128px;
8rem
Show All Classes
### Pixel width examples[](#pixel-width-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.w0
.w1
.w2
.w4
.w6
.w8
.w12
.w16
.w24
.w32
.w48
.w64
.w96
.w128
## Sizing units width[](#sizing-units-width)
Sizing units width classes allow you to set the width of an element according to a predefined set of 12 common values in used in Stacks.
### Sizing units width classes[](#sizing-units-width-classes)
Class
Output
rem value
`.ws1`
width: 128px;
8rem
`.ws2`
width: 256px;
16rem
`.ws3`
width: 344px;
21.5rem
`.ws4`
width: 448px;
28rem
`.ws5`
width: 512px;
32rem
`.ws6`
width: 640px;
40rem
`.ws7`
width: 768px;
48rem
`.ws8`
width: 848px;
53rem
`.ws9`
width: 960px;
60rem
`.ws10`
width: 1024px;
64rem
`.ws11`
width: 1120px;
70rem
`.ws12`
width: 1280px;
80rem
### Sizing units width examples[](#sizing-units-width-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
```
.ws1
.ws2
.ws3
.ws4
.ws5
.ws6
.ws7
.ws8
.ws9
.ws10
.ws11
.ws12
## Fluid width[](#fluid-width)
Fluid width classes allow you to set the width of an element to a percentage of the parent element’s width or to the full width of the viewport.
### Fluid width classes[](#fluid-width-classes)
Class
Output
Responsive?
`.w10`
width: 10%;
`.w20`
width: 20%;
`.w25`
width: 25%;
Yes
`.w30`
width: 30%;
`.w33`
width: 33%;
Yes
`.w40`
width: 40%;
`.w50`
width: 50%;
Yes
`.w60`
width: 60%;
`.w66`
width: 66%;
`.w70`
width: 70%;
`.w75`
width: 75%;
Yes
`.w80`
width: 80%;
`.w90`
width: 90%;
`.w100`
width: 100%;
Yes
`.w-screen`
width: 100vw;
Yes
`.w-auto`
width: auto;
Yes
### Fluid width examples[](#fluid-width-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
…
```
.w10
.w20
.w25
.w30
.w33
.w40
.w50
.w60
.w66
.w70
.w75
.w80
.w90
.w100
## Min width[](#min-width)
Min width classes allow you to set the minimum width of an element.
### Min width classes[](#min-width-classes)
Class
Output
rem value
Responsive?
`.wmn0`
min-width: 0;
Yes
`.wmn1`
min-width: 128px;
8rem
`.wmn2`
min-width: 256px;
16rem
`.wmn3`
min-width: 344px;
21.5rem
`.wmn4`
min-width: 448px;
28rem
`.wmn5`
min-width: 512px;
32rem
`.wmn6`
min-width: 640px;
40rem
`.wmn7`
min-width: 768px;
48rem
`.wmn8`
min-width: 848px;
53rem
`.wmn9`
min-width: 960px;
60rem
`.wmn10`
min-width: 1024px;
64rem
`.wmn11`
min-width: 1120px;
70rem
`.wmn12`
min-width: 1280px;
80rem
`.wmn25`
min-width: 25%;
`.wmn50`
min-width: 50%;
`.wmn75`
min-width: 75%;
`.wmn100`
min-width: 100%;
Yes
`.wmn-screen`
min-width: 100vw;
Yes
`.wmn-initial`
min-width: initial;
Yes
Show All Classes
## Max width[](#max-width)
Max width classes allow you to set the maximum width of an element.
### Max width classes[](#max-width-classes)
Class
Output
rem value
Responsive?
`.wmx1`
max-width: 128px;
8rem
`.wmx2`
max-width: 256px;
16rem
`.wmx3`
max-width: 344px;
21.5rem
`.wmx4`
max-width: 448px;
28rem
`.wmx5`
max-width: 512px;
32rem
`.wmx6`
max-width: 640px;
40rem
`.wmx7`
max-width: 768px;
48rem
`.wmx8`
max-width: 848px;
53rem
`.wmx9`
max-width: 960px;
60rem
`.wmx10`
max-width: 1024px;
64rem
`.wmx11`
max-width: 1120px;
70rem
`.wmx12`
max-width: 1280px;
80rem
`.wmx25`
max-width: 25%;
`.wmx50`
max-width: 50%;
`.wmx75`
max-width: 75%;
`.wmx100`
max-width: 100%;
Yes
`.wmx-screen`
max-width: 100vw;
Yes
`.wmx-initial`
max-width: initial;
Yes
Show All Classes
---
### Page: Z-Index
URL: https://stackoverflow.design/system/base/z-
Date: 2026-08-13T14:42:33.587Z
description: Atomic z-index classes allow you to change an element's z-index quickly.
Content:
## Classes[](#classes)
Class
Output
`.z-hide`
z-index: -1;
`.z-base`
z-index: 0;
`.z-selected`
z-index: 25;
`.z-active`
z-index: 50;
`.z-dropdown`
z-index: 1000;
`.z-popover`
z-index: 2000;
`.z-tooltip`
z-index: 3000;
`.z-banner`
z-index: 4000;
`.z-nav`
z-index: 5000;
`.z-nav-fixed`
z-index: 5050;
`.z-modal-bg`
z-index: 8050;
`.z-modal`
z-index: 9000;
## Examples[](#examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
```
.z-base
.z-hide
.z-selected
.z-active
.z-dropdown
.z-popover
.z-tooltip
.z-banner
.z-nav
.z-nav-fixed
.z-modal-bg
.z-modal
---
## Collection: components
### Page: Activity indicator
URL: https://stackoverflow.design/system/components/activity-indicator
Date: 2026-08-13T14:42:33.608Z
description: Stacks provides a small jewel for indicating new activity.
Content:
## Classes[](#classes)
Class
Description
Modifies
`.s-activity-indicator`
Base activity indicator element with theme-aware coloring
N/A
`.s-activity-indicator__success`
Applies success state styling
`.s-activity-indicator`
`.s-activity-indicator__warning`
Applies warning state styling
`.s-activity-indicator`
`.s-activity-indicator__danger`
Applies danger state styling
`.s-activity-indicator`
`.s-activity-indicator__sm`
Renders the indicator at a smaller size
`.s-activity-indicator`
## Examples[](#examples)
### Default[](#default)
By default, our indicator has no positioning attached to it. Depending on your context, you can modify the activity indicator’s positioning using any combination of atomic classes. Since our activity indicator has no inherent semantic meaning, make sure to include [visually-hidden, screenreader-only](/system/base/visibility) text with the `v-visible-sr` class.
```html
```
New activity
3
New activity
12
New activity
370
New activity
new
New activity
[
New activity
G
Grayson](#)
New activity
3
New activity
### Variations[](#variations)
Stacks also provides alternative styling for success, warning, and danger states.
```html
New activity
New activity
New activity
```
New activity
3
New activity
12
New activity
370
New activity
new
New activity
[
New activity
G
Grayson](#)
New activity
3
New activity
New activity
3
New activity
12
New activity
370
New activity
new
New activity
[
New activity
G
Grayson](#)
New activity
3
New activity
New activity
3
New activity
12
New activity
370
New activity
new
New activity
[
New activity
G
Grayson](#)
New activity
3
New activity
---
### Page: Avatars
URL: https://stackoverflow.design/system/components/avatars
Date: 2026-08-13T14:42:33.634Z
description: Avatars are used to quickly identify users or teams.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-avatar`
The base avatar at 16px.
N/A
N/A
`.s-avatar--image`
A child element for displaying a user's profile image.
`.s-avatar`
N/A
`.s-avatar--letter`
A child element for displaying an abbreviated Team name.
`.s-avatar`
N/A
`.s-avatar--badge`
A child element that provides positioning to the shield on Team avatars.
`.s-avatar`
N/A
`.s-avatar--indicator`
A child element that provides positioning to the activity indicator on user's avatars.
`.s-avatar`
N/A
`.s-avatar__24`
Adds the proper border radius and scaling at 24px.
N/A
`.s-avatar`
`.s-avatar__32`
Adds the proper border radius and scaling at 32px.
N/A
`.s-avatar`
`.s-avatar__48`
Adds the proper border radius and scaling at 48px.
N/A
`.s-avatar`
`.s-avatar__64`
Adds the proper border radius and scaling at 64px.
N/A
`.s-avatar`
`.s-avatar__96`
Adds the proper border radius and scaling at 96px.
N/A
`.s-avatar`
`.s-avatar__128`
Adds the proper border radius and scaling at 128px.
N/A
`.s-avatar`
Show All Classes
## Examples[](#examples)
### Users[](#users)
Including an image with the class `s-avatar--image` within `s-avatar` will apply the correct size. Remember, you’ll want to double the size of the avatar image to account for retina screens.
```html
```
Size
Class
Example
`16px`
`.s-avatar`
[ Example user](#)
`24px`
`.s-avatar__24`
[ Example user](#)
`32px`
`.s-avatar__32`
[ Example user](#)
`48px`
`.s-avatar__48`
[ Example user](#)
`64px`
`.s-avatar__64`
[ Example user](#)
`96px`
`.s-avatar__96`
[ Example user](#)
`128px`
`.s-avatar__128`
[ Example user](#)
### Activity[](#activity)
Avatars can display activity indicators to show activities or status changes. Add the `s-avatar--indicator` class to a child element of `s-avatar` along with `s-activity-indicator` and `s-activity-indicator__sm` classes. The indicator is positioned at the top-right corner of the avatar.
```html
```
Size
Class
Example
`16px`
`.s-avatar`
[ Example user
Online](#)
`24px`
`.s-avatar__24`
[ Example user
Online](#)
### Stack Internal[](#stack-internal)
When displaying a team’s identity, we badge the avatar with a shield. We fall back to the first letter of their name and a color we choose at random. As Stack Internal administrators add more data—choosing a color or uploading an avatar—we progressively enhance the avatar.
In this example, from left to right, we have a team name of Hum with no avatar or custom color. In the middle we have a team name of Hum with a custom color. In the last example, we have a team name of Hum with a custom avatar applied.
```html
Hum
@Svg.ShieldXSm.With("native s-avatar--badge")
```
Size
Class
Custom color
Brand color
Custom avatar
`16px`
`.s-avatar`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
`24px`
`.s-avatar__24`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
`32px`
`.s-avatar__32`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
`48px`
`.s-avatar__48`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
`64px`
`.s-avatar__64`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
`96px`
`.s-avatar__96`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
`128px`
`.s-avatar__128`
[H Hum Private](#)
[H Hum Private](#)
[ Hum Private](#)
---
### Page: Badges
URL: https://stackoverflow.design/system/components/badges
Date: 2026-08-13T14:42:33.753Z
description: Badges are labels used for flags, earned achievements, and number totals.
Content:
## Classes[](#classes)
Class
Description
Modifies
`.s-badge`
Base badge element.
N/A
`.s-badge__gold`
Badge indicating a gold award.
`.s-badge`
`.s-badge__silver`
Badge indicating a silver award.
`.s-badge`
`.s-badge__bronze`
Badge indicating a bronze award.
`.s-badge`
`.s-badge__important`
Applies important styling to the badge.
`.s-badge`
`.s-badge__squared`
Applies a background color to the badge's icon.
`.s-badge`
`.s-badge__info`
Badge indicating an info status.
`.s-badge`
`.s-badge__warning`
Badge indicating a warning status.
`.s-badge`
`.s-badge__danger`
Badge indicating a danger status.
`.s-badge`
`.s-badge__critical`
Badge indicating a critical status.
`.s-badge`
`.s-badge__tonal`
Badge indicating a tonal status.
`.s-badge`
`.s-badge__success`
Badge indicating a success status.
`.s-badge`
`.s-badge__featured`
Badge indicating a featured status.
`.s-badge`
`.s-badge__sm`
Applies a small size to the badge.
`.s-badge`
`.s-badge__lg`
Applies a large size to the badge.
`.s-badge`
Show All Classes
## Styles[](#styles)
### Default[](#default)
```html
default
```
default
### General[](#general)
A general-purpose badge used for functional information and system-level status updates.
```html
Badge
general
```
Badge general
### Reputation[](#reputation)
A reputation badge to display a user’s total rep count.
```html
Rep badge
99 rep
```
Rep badge 99 rep
### Activity[](#activity)
An activity badge to signal real-time events and draw attention.
```html
Activity badge
new message
```
Activity badge new message
### Achievement[](#achievement)
Badges that provide information about user achievements.
```html
Gold badge
Great Question
Silver badge
Favorite Question
Bronze badge
Altruist
```
Example
Description
gold badge Great Question
Gold badge achievement that a user earns within a community.
silver badge Favorite Question
Silver badge achievement that a user earns within a community.
bronze badge Altruist
Bronze badge achievement that a user earns within a community.
### Tag[](#tag)
Badges that display achievements a user has earned for their contributions within a specific topic/tag.
```html
Gold tag badge
python
Silver tag badge
css
Bronze tag badge
javascript
```
Example
Modifier class
Description
python
`.s-badge__gold`
Gold badge achievement that a user earns for a specific tag within a community.
css
`.s-badge__silver`
Silver badge achievement that a user earns for a specific tag within a community.
javascript
`.s-badge__bronze`
Bronze badge achievement that a user earns for a specific tag within a community.
### States[](#states)
Use State badges to communicate semantic status or severity, such as success, warning, or danger. These variants apply specific system colors to convey meaning and can be configured with or without icons.
```html
@Svg.Document Archived @Svg.Compose Draft @Svg.Eye Review @Svg.Flag Closed @Svg.Challenge Deleted @Svg.Key Pinned @Svg.Check Success @Svg.Star New
```
Example
Modifier class
Description
Archived
N/A
Neutral badge styling. Can be used to indicate an inactive state that requires minimal visual emphasis.
Draft
`.s-badge__info`
Info badge styling.
Review
`.s-badge__warning`
Warning badge styling.
Closed
`.s-badge__danger`
Danger badge styling.
Deleted
`.s-badge__critical`
Critical badge styling.
Pinned
`.s-badge__tonal`
Tonal badge styling.
Success
`.s-badge__success`
Success badge styling.
New
`.s-badge__featured`
Featured badge styling. Can be used to draw attention to the new features and changes.
### Squared[](#squared)
Use the squared variant sparingly to provide additional emphasis, reserving it primarily for states related to gamification or achievements.
```html
@Svg.Check Accepted answer
@Svg.VoteUp Earn badge
```
Example
Modifier classes
Description
Accepted answer
`.s-badge__squared``.s-badge__success`
Success badge styling in squared variant.
Earn badge
`.s-badge__squared``.s-badge__featured`
Featured badge styling in squared variant.
### Important[](#important)
Emboldens the above visual styles by strengthening the background saturation. This should be used for time-sensitive, pressing information that needs to be noticed by the user.
```html
@Svg.Notification Needs attention
@Svg.VoteUp Ending soon
Spam +100
```
Example
Modifier classes
Description
Needs attention
`.s-badge__warning``.s-badge__squared``.s-badge__important`
Warning badge styling in squared variant with important styling.
Ending soon
`.s-badge__danger``.s-badge__important`
Danger badge styling with important styling.
Spam
`.s-badge__critical``.s-badge__important`
Critical badge styling with important styling.
+100
`.s-badge__info``.s-badge__important`
Info badge styling in small size with important styling.
### User[](#user)
```html
AdminModeratorStaffBotAINew
```
Example
Class
Description
Admin
`.s-badge__admin`
Badge indicating user is an admin.
Moderator
`.s-badge__moderator`
Badge indicating user is an moderator.
Staff
`.s-badge__staff`
Badge indicating user is staff.
AI
`.s-badge__ai`
Badge indicating content is AI generated.
Bot
`.s-badge__bot`
Badge indicating user is a bot.
New
`.s-badge__new`
Badge indicating new user.
### Sizes[](#sizes)
Badges come in three sizes.
```html
Small Default Large
```
Example
Modifier class
Description
Small
`.s-badge__sm`
The badge in small size.
Default
N/A
The badge in default size.
Large
`.s-badge__lg`
The badge in large size.
---
### Page: Banners
URL: https://stackoverflow.design/system/components/banners
Date: 2026-08-13T14:42:33.793Z
description: Banners are full-width notices used for system and engagement messaging. They are highly intrusive and should be used only when essential information needs to be conveyed to the user.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-banner`
Base banner element.
N/A
N/A
`.s-banner--actions`
Container styling for banner actions including the dismiss button.
`.s-banner`
N/A
`.s-banner--dismiss`
Applies to child button element within the banner to position it appropriately.
`.s-banner`
N/A
`.s-banner__important`
Applies an important visual style. This should be used for time-sensitive, pressing information that needs to be noticed by the user.
N/A
`.s-banner`
`.s-banner__info`
Applies info (blue) visual styles.
N/A
`.s-banner`
`.s-banner__success`
Applies success (green) visual styles.
N/A
`.s-banner`
`.s-banner__warning`
Applies warning (yellow) visual styles.
N/A
`.s-banner`
`.s-banner__danger`
Applies danger (red) visual styles.
N/A
`.s-banner`
`.s-banner__featured`
Applies featured (purple) visual styles.
N/A
`.s-banner`
`.s-banner__activity`
Applies activity (pink) visual styles.
N/A
`.s-banner`
`.is-pinned`
Pins the banner to the top of the browser window.
N/A
`.s-banner`
Show All Classes
## Usage guidelines[](#usage-guidelines)
System banners are used for **system** messaging. They are full-width notices placed in one of two locations:
* **Pinned to the top of the browser window** — Use when the banner relates to the entire website (e.g. the site is in read-only mode). Add `.is-pinned` to pin the banner above all other content including the topbar.
* **Below the top navigation bar** — The default placement. Use when the banner affects only a particular area of the product (e.g. a subscription is about to expire).
Refer to the [Classes section](#classes) for more information on how to apply the correct styles.
## Examples[](#examples)
Style
BaseInfoSuccessWarningDangerFeaturedActivity
Important?
Pinned?
Show example
### Base[](#base)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
### Info[](#info)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
### Success[](#success)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
### Warning[](#warning)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
### Danger[](#danger)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
### Featured[](#featured)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
### Activity[](#activity)
```html
…
…
```
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
**Stacks is currently frozen in read-only mode.** Contact the team to restore access.
## JavaScript[](#javascript)
The `.s-banner` component includes a controller to show and hide the banner programitically. While it is optional, at least including the functionality to close the banner is recommended.
### Example[](#example)
```html
Example banner
…
```
```javascript
document
.querySelector(".js-banner-toggle")
.addEventListener("click", function (e) {
Stacks.showBanner(document.querySelector("#example-banner"));
});
```
### Attributes[](#attributes)
Attribute
Description
Applies to
`data-controller="s-banner"`
Wires up the element to the banner controller. This may be a \`.s-banner\` element or a wrapper element.
Controller element
`data-s-banner-target="banner"`
Wires up the element that is to be shown/hidden.
`.s-banner element`
`data-s-banner-remove-when-hidden="true"`
(optional) Removes the banner from the DOM entirely when it is hidden.
Controller element
### Events[](#events)
Event
Description
Applies to
`s-banner:show`
Fires immediately before showing the banner. Calling \`.preventDefault()\` cancels the display of the banner.
Banner target
`s-banner:shown`
Fires after the banner has been visually shown.
Banner target
`s-banner:hide`
Fires immediately before hiding the banner. Calling \`.preventDefault()\` cancels the removal of the banner.
Banner target
`s-banner:hidden`
Fires after the banner has been visually hidden.
Banner target
### Event details[](#event-details)
event.detail
Description
Applicable events
`dispatcher`
Contains the \`Element\` that initiated the event. For instance, the button clicked to show, the element clicked outside the banner that caused it to hide, etc.
N/A
### Helpers[](#helpers)
Function
Description
Applies to
`Stacks.showBanner`
Helper to manually show an s-banner element via external JS.
Controller element
`Stacks.hideBanner`
Helper to manually hide an s-banner element via external JS.
Controller element
---
### Page: Bling
URL: https://stackoverflow.design/system/components/bling
Date: 2026-08-13T14:42:33.850Z
description: Bling is used to indicate award type in badges and user cards.
Content:
## Classes[](#classes)
Class
Description
Modifies
`.s-bling`
Base bling element.
N/A
`.s-bling__gold`
Gold bling element.
`.s-bling`
`.s-bling__silver`
Silver bling element.
`.s-bling`
`.s-bling__bronze`
Bronze bling element.
`.s-bling`
`.s-bling__activity`
Activity bling element.
`.s-bling`
`.s-bling__filled`
Filled bling element.
`.s-bling`
`.s-bling__rep`
Reputation bling element.
`.s-bling`
`.s-bling__sm`
Small bling element.
`.s-bling`
`.s-bling__lg`
Large bling element.
`.s-bling`
Show All Classes
## Types[](#types)
Use the clear bling variant only when its associated color is already present in the component, such as within a colored tag badge or alongside a filled element.
```html
…………
```
Example
Class
Description
default bling
`.s-bling`
A general bling shape used for reputation, notifications or other.
gold bling
`.s-bling``.s-bling__gold`
The "gold" award bling shape.
silver bling
`.s-bling``.s-bling__silver`
The "silver" award bling shape.
bronze bling
`.s-bling``.s-bling__bronze`
The "bronze" award bling shape.
## Filled[](#filled)
Use the filled bling style to represent a specific achievement badge or to display the total count of badges a user has earned.
```html
………………
```
Example
Class
Description
default bling
`.s-bling``.s-bling__filled`
A general bling used for information, status, labels or other.
rep bling
`.s-bling``.s-bling__filled``.s-bling__rep`
A "rep" bling used for general reputation points.
activity bling
`.s-bling``.s-bling__filled``.s-bling__activity`
An activity bling to signal real-time events and draw attention.
gold bling
`.s-bling``.s-bling__filled``.s-bling__gold`
A "gold" award bling.
silver bling
`.s-bling``.s-bling__filled``.s-bling__silver`
A "silver" award bling.
bronze bling
`.s-bling``.s-bling__filled``.s-bling__bronze`
A "bronze" award bling.
## Sizes[](#sizes)
A bling component has a default size. To change the bling’s size, apply one of the following sizing classes along with the base `.s-bling` class.
```html
………
```
Example
Class
Description
sm bling
`.s-bling``.s-bling__filled``.s-bling__sm`
A "sm" bling.
default bling
`.s-bling``.s-bling__filled`
A "default" bling.
lg bling
`.s-bling``.s-bling__filled``.s-bling__lg`
A "lg" bling.
---
### Page: Breadcrumbs
URL: https://stackoverflow.design/system/components/breadcrumbs
Date: 2026-08-13T14:42:33.857Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Button Groups
URL: https://stackoverflow.design/system/components/button-groups
Date: 2026-08-13T14:42:33.858Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Buttons
URL: https://stackoverflow.design/system/components/buttons
Date: 2026-08-13T14:42:33.858Z
description: Buttons are user interface elements which allows users to take actions throughout the project. It is important that they have ample click space and help communicate the importance of their actions.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-btn`
Base button element.
N/A
N/A
`.s-btn--badge`
Badge container for the button.
`.s-btn`
N/A
`.s-btn__clear`
Clear button variant.
N/A
`.s-btn`
`.s-btn__danger`
Danger button variant.
N/A
`.s-btn`
`.s-btn__featured`
Featured button variant.
N/A
`.s-btn`
`.s-btn__tonal`
Tonal button variant.
N/A
`.s-btn`
`.s-btn__dropdown`
Dropdown button variant.
N/A
`.s-btn`
`.s-btn__icon`
Icon button variant.
N/A
`.s-btn`
`.s-btn__link`
Link button variant.
N/A
`.s-btn`
`.s-btn__unset`
Unset button variant.
N/A
`.s-btn`
`.s-btn__facebook`
Facebook button variant.
N/A
`.s-btn`
`.s-btn__github`
GitHub button variant.
N/A
`.s-btn`
`.s-btn__google`
Google button variant.
N/A
`.s-btn`
`.s-btn__xs`
Extra small button variant.
N/A
`.s-btn`
`.s-btn__sm`
Small button variant.
N/A
`.s-btn`
`.s-btn__lg`
Large button variant.
N/A
`.s-btn`
Show All Classes
## Styles[](#styles)
Stacks provides 3 different button styles:
1. [Base](#base)
2. [Danger](#danger)
3. [Featured](#featured)
4. [Tonal](#tonal)
Each style is explained below, detailing how and where to use these styles.
### Base[](#base)
Base buttons can gain clear styling with the `.s-btn__clear` class.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn`
Ask question
Ask question
Ask question
Clear
`.s-btn` `.s-btn__clear`
Ask question
Ask question
Ask question
### Danger[](#danger)
Danger buttons are a secondary button style, used to visually communicate destructive actions such as deleting content, accounts, or canceling services.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn` `.s-btn__danger`
Ask question
Ask question
Ask question
Clear
`.s-btn` `.s-btn__danger` `.s-btn__clear`
Ask question
Ask question
Ask question
### Featured[](#featured)
Featured buttons are a secondary button style, used to visually draw attention to something new or temporary, usually as part of onboarding or to announce a new feature. These should be used sparingly, and permanent placements should be avoided.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn` `.s-btn__featured`
Ask question
Ask question
Ask question
### Tonal[](#tonal)
Tonal buttons are a secondary button style, a grayscale visual treatment. Used in layouts for the least important items or currently inactive actions.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn` `.s-btn__tonal`
Ask question
Ask question
Ask question
## Anchors[](#anchors)
Anchors can be rendered with the `.s-btn` to adopt a button-like visual style for a link.
```html
Ask question
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn`
[Ask question](#)
[Ask question](#)
[Ask question](#)
Base, Clear
`.s-btn` `.s-btn__clear`
[Ask question](#)
[Ask question](#)
[Ask question](#)
Danger
`.s-btn` `.s-btn__danger`
[Ask question](#)
[Ask question](#)
[Ask question](#)
Danger, Clear
`.s-btn` `.s-btn__danger` `.s-btn__clear`
[Ask question](#)
[Ask question](#)
[Ask question](#)
Featured
`.s-btn` `.s-btn__featured`
[Ask question](#)
[Ask question](#)
[Ask question](#)
Tonal
`.s-btn` `.s-btn__tonal`
[Ask question](#)
[Ask question](#)
[Ask question](#)
## Loading[](#loading)
Any button can have a loading state applied by adding the `.is-loading` state class.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn` `.is-loading`
Loading…
Ask question
Loading…
Ask question
Loading…
Ask question
Base, Clear
`.s-btn` `.s-btn__clear` `.is-loading`
Loading…
Ask question
Loading…
Ask question
Loading…
Ask question
Danger
`.s-btn` `.s-btn__danger` `.is-loading`
Loading…
Ask question
Loading…
Ask question
Loading…
Ask question
Danger, Clear
`.s-btn` `.s-btn__danger` `.s-btn__clear` `.is-loading`
Loading…
Ask question
Loading…
Ask question
Loading…
Ask question
Featured
`.s-btn` `.s-btn__featured` `.is-loading`
Loading…
Ask question
Loading…
Ask question
Loading…
Ask question
Tonal
`.s-btn` `.s-btn__tonal` `.is-loading`
Loading…
Ask question
Loading…
Ask question
Loading…
Ask question
## Dropdowns[](#dropdowns)
Adding the class `.s-btn__dropdown` to any button style will add an appropriately-styled caret. These should be paired with a menu or popover.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn` `.s-btn__dropdown`
Ask question
Ask question
Ask question
Base, Clear
`.s-btn` `.s-btn__clear` `.s-btn__dropdown`
Ask question
Ask question
Ask question
Danger
`.s-btn` `.s-btn__danger` `.s-btn__dropdown`
Ask question
Ask question
Ask question
Danger, Clear
`.s-btn` `.s-btn__danger` `.s-btn__clear` `.s-btn__dropdown`
Ask question
Ask question
Ask question
Featured
`.s-btn` `.s-btn__featured` `.s-btn__dropdown`
Ask question
Ask question
Ask question
Tonal
`.s-btn` `.s-btn__tonal` `.s-btn__dropdown`
Ask question
Ask question
Ask question
## Badges[](#badges)
Adding an `.s-btn--badge` to any button will add an appropriately-styled badge.
```html
```
Type
Class
Default State
Selected State
Disabled State
Base
`.s-btn` `.s-btn--badge`
Active 198
Active 198
Active 198
Base, Clear
`.s-btn` `.s-btn__clear` `.s-btn--badge`
Active 198
Active 198
Active 198
Danger
`.s-btn` `.s-btn__danger` `.s-btn--badge`
Active 198
Active 198
Active 198
Danger, Clear
`.s-btn` `.s-btn__danger` `.s-btn__clear` `.s-btn--badge`
Active 198
Active 198
Active 198
Featured
`.s-btn` `.s-btn__featured` `.s-btn--badge`
Active 198
Active 198
Active 198
Tonal
`.s-btn` `.s-btn__tonal` `.s-btn--badge`
Active 198
Active 198
Active 198
## Sizes[](#sizes)
A button’s default font-size is determined by the `@body-fs` variable. To change the button’s font-size, use the following classes with `.s-btn`:
Warning **Note:** Avoid using icons within the extra small button size. This variant is designed for tight spaces, and standard icons are too large to fit without breaking the button's height and layout.
Type
Class
Size
Example
Default
_N/A_
14px
Ask question
Extra Small
`s-btn__xs`
12px
Ask question
Small
`s-btn__sm`
13px
Ask question
Large
`s-btn__lg`
17px
Ask question
## Toggle buttons[](#toggle-buttons)
Each button class has a selected state which can be visually activated by applying the `.is-selected` class. When a button can switch between selected and unselected states, it is important to also annotate the button with the `aria-pressed` attribute for accessibility. A `title` attribute may also be appropriate to describe what will happen when pressing the button.
```html
```
Initially unselected toggle button Initially selected toggle button
## Additional styles[](#additional-styles)
Stacks provides additional classes for cases that are a bit more rare.
### Disabled[](#disabled)
Type
Attribute
Definition
Example
Disabled
`[aria-disabled="true"]`
Adds disabled styling to any element with `.s-btn` applied.
[Ask question](#)
### Resets[](#resets)
Type
Class
Definition
Example
Unset
`.s-btn__unset`
Removes all styling from a button and reverts focus states to browser default.
Unset button
Link
`.s-btn__link`
Styles a button element as though it were a link. Instead of transforming an `s-btn` to a link, you most likely want to style a `button` as a [link](/system/components/links).
Link button
### Icons[](#icons)
Type
Class
Definition
Examples
Icon
`.s-btn__icon`
Adds some margin overrides that apply to an icon within a button.
Delete up
### Social[](#social)
Type
Class
Definition
Examples
Facebook
`.s-btn__facebook`
Styles a button consistent with Facebook's branding.
Facebook
Google
`.s-btn__google`
Styles a button consistent with Google's branding.
Google
GitHub
`.s-btn__github`
Styles a button consistent with GitHub's branding.
GitHub
## Ordering[](#ordering)
To maintain product consistency, buttons should maintain the following layout ordering:
### Within a row[](#within-a-row)
Most button groups should be ordered from the most important to the least important action, left to right.
```html
```
Post answer Cancel
### Within a column[](#within-a-column)
Sometimes the layout dictates that buttons need to be stacked on top of each other. Again, these buttons should be stacked from the most important to the least important, top to bottom.
```html
```
Post answer Cancel
### Within a header[](#within-a-header)
Sometimes the best place for a series of actions is in the same area as the title. In these cases, the buttons should be pulled to the right. Within this instance, the button order should be reversed with the most important action to the far right and the least important action to the far left.
```html
Write your response
```
### Write your response
Cancel Post answer
---
### Page: Cards
URL: https://stackoverflow.design/system/components/cards
Date: 2026-08-13T14:42:33.912Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Code blocks
URL: https://stackoverflow.design/system/components/code-blocks
Date: 2026-08-13T14:42:33.913Z
description: Stacks provides styling for code blocks with syntax highlighting provided by highlight.js. Special care was taken to make sure our light and dark themes felt like Stack Overflow while maintaining near AAA color contrasts and still being distinguishable for those with a color vision deficiency.
Content:
## Classes[](#classes)
Class
Description
Modifies
`.s-code-block`
Base code block style.
N/A
`.linenums`
Adds a line numbers column to the code block.
`.s-code-block`
`.linenums:`
Adds a line numbers column to the code block starting at a number .
`.s-code-block`
## Language examples[](#language-examples)
The following examples are a small subset of the languages that `highlight.js` supports.
### HTML[](#html)
```html
```
```java
package l2f.gameserver.model;
public abstract strictfp class L2Char extends L2Object {
public static final Short ERROR = 0x0001;
public void moveTo(int x, int y, int z) {
_ai = null;
log("Should not be called");
if (1 > 5) { // what?
return;
}
}
}
```
### Ruby[](#ruby)
```html
…
```
```ruby
# The Greeter class
class Greeter
def initialize(name)
@name = name.capitalize
end
def salute
puts "Hello #{@name}!"
end
end
g = Greeter.new("world")
g.salute
```
### Python[](#python)
```html
…
```
```python
def all_indices(value, qlist):
indices = []
idx = -1
while True:
try:
idx = qlist.index(value, idx+1)
indices.append(idx)
except ValueError:
break
return indices
all_indices("foo", ["foo","bar","baz","foo"])
```
### Objective-C[](#objective-c)
```html
```
```csharp
using System.IO.Compression;
#pragma warning disable 414, 3021
namespace MyApplication
{
[Obsolete("...")]
class Program : IInterface
{
public static List JustDoIt(int count)
{
Console.WriteLine($"Hello {Name}!");
return new List(new int[] { 1, 2, 3 })
}
}
}
```
### SQL[](#sql)
```html
…
```
```sql
CREATE TABLE "topic" (
"id" serial NOT NULL PRIMARY KEY,
"forum_id" integer NOT NULL,
"subject" varchar(255) NOT NULL
);
ALTER TABLE "topic"
ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id")
REFERENCES "forum" ("id");
-- Initials
insert into "topic" ("forum_id", "subject")
values (2, 'D''artagnian');
```
### Diff[](#diff)
```html
…
```
```diff
Index: languages/ini.js
===================================================================
--- languages/ini.js (revision 199)
+++ languages/ini.js (revision 200)
@@ -1,8 +1,7 @@
hljs.LANGUAGES.ini =
{
case_insensitive: true,
- defaultMode:
- {
+ defaultMode: {
contains: ['comment', 'title', 'setting'],
illegal: '[^\\s]'
},
*** /path/to/original timestamp
--- /path/to/new timestamp
***************
*** 1,3 ****
--- 1,9 ----
+ This is an important
+ notice! It should
+ therefore be located at
+ the beginning of this
+ document!
! compress the size of the
! changes.
It is important to spell
```
## Line numbers[](#line-numbers)
Add `.linenums` to include line numbers on a code block.
### Default[](#default)
```html
…
```
```html
123456
```
### Offset[](#offset)
Append a number preceeded by `:` to `.linenums` to offset the start of the line numbers.
```html
…
```
```json
232425262728293031323334[ { "title": "apples", "count": [12000, 20000], "description": {"text": "...", "sensitive": false} }, { "title": "oranges", "count": [17500, null], "description": {"text": "...", "sensitive": false} }]
```
---
### Page: Editor
URL: https://stackoverflow.design/system/components/editor/
Date: 2026-08-13T14:42:33.934Z
description: The Stacks editor adds "what you see is what you get" and Markdown capabilities to textareas. It is available as a separate Editor repository, but requires Stacks' CSS for styling.
Content:
Because of its size, the Stacks editor is bundled independently of Stacks. You can install it a few ways:
## Installation[](#installation)
### NPM[](#npm)
The Stacks Editor is available as an NPM package. To make it available in your node modules, `npm install @stackoverflow/stacks-editor`
### Import via Modules or CommonJS[](#import-via-modules-or-commonjs)
```javascript
import { StacksEditor } from "@stackoverflow/stacks-editor";
// Don't forget to include the styles as well
import "@stackoverflow/stacks-editor/styles.css";
new StacksEditor(
document.querySelector("#editor-container"),
"*Hello* World!",
{}
);
```
### Import via script tag[](#import-via-script-tag)
```html
```
## Configuration[](#configuration)
There are several options you can pass to the Stacks Editor.
## Examples[](#examples)
### Empty[](#empty)
```html
```
### Textarea content with tables enabled[](#textarea-content-with-tables-enabled)
```html
```
---
### Page: Empty states
URL: https://stackoverflow.design/system/components/empty-states
Date: 2026-08-13T14:42:33.937Z
description: Empty states are used when there is no data to show. Ideally they orient the user by providing feedback based on the the user's last interaction or communicate the benefits of a feature. When appropriate, they should explain the next steps the user should take and provide guidance with a clear call-to-action.
Content:
## Classes[](#classes)
Class
Description
Modifies
`.s-empty-state`
Base empty state style.
N/A
## No data or results[](#no-data-or-results)
Typical use-case for an empty state is when a feature has no data or a search/filter operation yields no results.
### Actionable[](#actionable)
If the user is able to address the situation resulting in an empty state, it is appropriate to include a button for them to do so.
```html
@Svg.Spot.Empty.With("native")
No questions match your result.
Try refining your search term or trying something more general.
```
#### No questions match your result.
Try refining your search term or trying something more general.
Clear filters
### Non-actionable[](#non-actionable)
If the user can’t take an action to fix the situation, it’s appropriate to set expectations.
```html
@Svg.Spot.Empty.With("native")
User trends not ready
Please check back in a few days.
```
#### User trends not ready
Please check back in a few days.
### Minimal[](#minimal)
If desired, both the title and call-to-action may be omitted for a minimal look.
```html
```
There's no data associated with [this account](#).
---
### Page: Expandable
URL: https://stackoverflow.design/system/components/expandable
Date: 2026-08-13T14:42:33.949Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Link Previews
URL: https://stackoverflow.design/system/components/link-previews
Date: 2026-08-13T14:42:33.949Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Links
URL: https://stackoverflow.design/system/components/links
Date: 2026-08-13T14:42:33.950Z
description: Links are lightly styled via the a element by default. In addition, we provide .s-link and its variations. In rare situations, .s-link can be applied to a button while maintaining the look of an anchor.
Content:
## Links[](#links)
### Link classes[](#link-classes)
Class
Description
Modifies
`.s-link`
Base link style that is used almost universally.
N/A
`.s-link__grayscale`
A link style modification with our default text color.
`.s-link`
`.s-link__muted`
Applies a visually muted style to the base style.
`.s-link`
`.s-link__danger`
Applies an important, destructive red to the base style.
`.s-link`
`.s-link__inherit`
Applies the parent element's text color.
`.s-link`
`.s-link__underlined`
Adds an underline to the link's text.
`.s-link`
`.s-link__dropdown`
Applies a caret for dropdowns and additional interactivity.
`.s-link`
### Single link examples[](#single-link-examples)
```html
DefaultGrayscaleMutedDangerInheritUnderlinedLinks
```
[Default](#) [Grayscale](#) [Muted](#) [Danger](#) [Inherit](#) [Underlined](#) Button Link [Links](#)
### Accessibility[](#accessibility)
Any link with adjacent static text cannot use color alone to differentiate it as a link. If a link is next to static text and the only visual indication that it’s a link is the color of the text, it will require an underline in addition to the color. Reference [WCAG SC 1.4.1](https://www.w3.org/WAI/WCAG22/Techniques/failures/F73) for more details.
## Anchors[](#anchors)
### Anchor classes[](#anchor-classes)
Class
Description
Modifies
`.s-anchors`
A consistent link style is applied to all descendent anchors.
N/A
`.s-anchors__default`
All descendent links receive s-link's default styling.
`.s-anchors`
`.s-anchors__grayscale`
Applies gray styling to all descendent links.
`.s-anchors`
`.s-anchors__muted`
Applies a visually muted style to all descendent links.
`.s-anchors`
`.s-anchors__danger`
Applies an important, destructive red to all descendent links.
`.s-anchors`
`.s-anchors__underlined`
Applies an underline to all descendent links.
`.s-anchors`
`.s-anchors__inherit`
Applies the parent element's text color to all descendent links.
`.s-anchors`
### Anchor examples[](#anchor-examples)
Sometimes you need to give all `` elements inside a container or component the same color, even when it’s impractical or even impossible to give each anchor element an `s-link` class (e.g. because the markup is generated from Markdown).
In this case, you can add the `s-anchors` class together with one of the modifiers `s-anchors__default`, `s-anchors__grayscale`, `s-anchors__muted`, `s-anchors__danger`, or `s-anchors__inherit` to the container.
```html
```
All [links](#) in this [outer box](#) are [dangerous](#).
But all [links](#) in this [inner box](#) have the [default](#) link color.
An explicit `s-link` on an anchor overrides any `s-anchors` setting:
```html
```
All [links](#) in this [box](#) are [dangerous](#), except for this one which uses the default color, and this muted link.
---
### Page: Loader
URL: https://stackoverflow.design/system/components/loader
Date: 2026-08-13T14:42:33.957Z
description: The loader component indicates an active wait state for a page, section, or interactive element.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-loader`
Base class for the loader component.
N/A
N/A
`.s-loader--sr-text`
Necessary to render the center loader block and renders the accessible text.
`.s-loader`
N/A
`.s-loader__sm`
A small variant of the loader component.
N/A
`.s-loader`
`.s-loader__lg`
A large variant of the loader component.
N/A
`.s-loader`
## Examples[](#examples)
### Base[](#base)
The base loader component displays three animated squares.
```html
Loading…
```
Loading…
### Sizes[](#sizes)
Example
Class
Description
Loading…
`.s-loader``.s-loader__sm`
A small variant of the loader component.
Loading…
`.s-loader`
Base class for the loader component.
Loading…
`.s-loader``.s-loader__lg`
A large variant of the loader component.
---
### Page: Menus
URL: https://stackoverflow.design/system/components/menus
Date: 2026-08-13T14:42:33.990Z
description: A menu offers a contextual list of actions or functions.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-menu`
Base container styling for a menu.
N/A
N/A
`.s-menu--divider`
Adds a divider line between menu sections.
`.s-menu`
N/A
`.s-menu--item`
Applies link styling to link within a menu. Used for actionable elements.
`.s-menu`
N/A
`.s-menu--title`
Adds appropriate styling for a title within a menu.
`.s-menu`
N/A
`.s-menu--icon`
Applies styling to an icon.
`.s-menu--item`
N/A
`.s-menu--action`
Applies link styling to link within a menu. Used for actionable elements.
`.s-menu--item`
N/A
`.s-menu--action__danger`
Applies danger styling to a menu link. Used for destructive actions.
N/A
`.s-menu--action`
## Examples[](#examples)
A menu displays a list of choices temporarily, and usually represent tasks or actions. Don’t confuse menus for [navigation](/system/components/navigation).
### Basic[](#basic)
At its most basic, a menu is a simple styled list of contextual actions. Because they’re contextual, it’s strongly recommended that a menu is contained within a [popover](/system/components/popovers) or a [card](/system/components/cards). When placed in various containers, you’ll need to either account for the padding on the container, or use negative margins on the menu component itself.
```html
```
Within a popover
* [Share](#)
* [Edit](#)
* [Follow](#)
Within a card
* [Share](#)
* [Edit](#)
* [Follow](#)
No container
* [Share](#)
* [Edit](#)
* [Follow](#)
### Titles and dividers[](#titles-and-dividers)
You can split up your menu by using either titles, dividers, or some combination of the two. Titles help group similar conceptual actions—in this example, we’ve grouped all sharing options. We’ve also split our destructive actions into their own section using a divider.
```html
```
* Share
* [Email](#)
* [Facebook](#)
* [Twitter](#)
* [Deactivate](#)
* [Delete](#)
### Icons[](#icons)
Icons can be added to menu items to help visually distinguish actions. Include the `s-menu--icon` class on the icon to ensure proper spacing and alignment.
```html
```
* [Home](#)
* [Inbox](#)
* [Settings](#)
### Selected states[](#selected-states)
To create selectable menu items, add `.s-checkbox.s-checkbox__checkmark` or `.s-radio.s-radio__checkmark` to the `.s-menu--action` element and include a radio or checkbox input as a child element. When the input is `:checked`, the corresponding menu item displays a checkmark.
```html
```
With radio input
Select one
Frequent
Votes
Unanswered
With checkbox input
Select multiple
Frequent
Votes
Unanswered
### Radio groups[](#radio-groups)
In the case of user management, it’s appropriate to include radio options. In this example, we’re setting a user’s role. While our examples up to this point have all been simple unordered lists, the `s-menu` component works on any markup including `fieldset`.
```html
```
Role
User
Can view, ask, answer, and edit questions. Can also vote on and flag content.
Moderator
Everything a user can do, but can also delete and close questions.
Admin
Everything a moderator can do and can also manage users, permissions, and site settings.
---
### Page: Modals
URL: https://stackoverflow.design/system/components/modals
Date: 2026-08-13T14:42:34.014Z
description: Modals are dialog overlays that prevent the user from interacting with the rest of the website until an action is taken or the dialog is dismissed. Modals are purposefully disruptive and should be used thoughtfully and sparingly.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-modal`
Base parent container for modals.
N/A
N/A
`.s-modal--dialog`
Creates a container that holds the modal dialog with proper padding and shadows.
`.s-modal`
N/A
`.s-modal--body`
Adds proper styling to the modal dialog's body text.
`.s-modal--dialog`
N/A
`.s-modal--close`
Used to dismiss a modal.
`.s-modal--dialog`
N/A
`.s-modal--header`
Adds proper styling to the modal dialog's header.
`.s-modal--dialog`
N/A
`.s-modal--footer`
Adds the desired spacing to the row of button actions.
`.s-modal--dialog`
N/A
`.s-modal__danger`
Adds styling for potentially dangerous actions.
N/A
`.s-modal`
`.s-modal__full`
Makes the container take up as much of the screen as possible.
N/A
`.s-modal--dialog`
Show All Classes
## JavaScript[](#javascript)
### Attributes[](#attributes)
Attribute
Description
Applies to
`data-controller="s-modal"`
Wires up the element to the modal controller. This may be a \`.s-modal\` element or a wrapper element.
Controller element
`data-s-modal-target="modal"`
Wires up the element that is to be shown/hidden.
`.s-modal element`
`data-s-modal-target="initialFocus"`
Designates which element to focus on modal show. If absent, defaults to the first focusable element within the modal.
Any child focusable element
`data-action="s-modal#toggle"`
Wires up the element that is to be shown/hidden.
Any child focusable element
`data-action="s-modal#hide"`
Wires up the element that is to be shown/hidden.
Any child focusable element
`data-s-modal-return-element="[selector]"`
Designates the element to return focus to when the modal is closed. If left unset, focus is not altered on close.
Controller element
`data-s-modal-remove-when-hidden="true"`
Removes the modal from the DOM entirely when it is hidden.
Controller element
Show all attributes
### Events[](#events)
Event
Description
Applies to
`s-modal:show`
Fires immediately before showing the modal. Calling \`.preventDefault()\` cancels the display of the modal.
Modal target
`s-modal:shown`
Fires after the modal has been visually shown.
Modal target
`s-modal:hide`
Fires immediately before hiding the modal. Calling \`.preventDefault()\` cancels the removal of the modal.
Modal target
`s-modal:hidden`
Fires after the modal has been visually hidden.
Modal target
### Event details[](#event-details)
Property
Description
Applies to
`dispatcher`
Contains the \`Element\` that initiated the event. For instance, the button clicked to show, the element clicked outside the modal that caused it to hide, etc.
Modal target
`returnElement`
Contains the \`Element\` to return focus to on hide. If a value is set to this property inside an event listener, it will be updated on the controller as well.
Modal target
### Helpers[](#helpers)
Helper
Description
Applies to
`Stacks.showModal`
Helper to manually show an s-modal element via external JS.
Controller element
`Stacks.hideModal`
Helper to manually hide an s-modal element via external JS.
Controller element
## Accessibility[](#accessibility)
Attribute
Description
Applies to
`aria-describedby="[id]"`
Supply the modal's summary copy id. Assistive technologies use this to associate static text with a widget, element groups, headings, definitions, etc.
Modal target
`aria-hidden="[state]"`
Informs assistive technologies if they should ignore the element. This should not be confused with the HTML5 \`hidden\` attribute.
Modal target
`aria-label="[text]"`
Labels the element for assistive technologies.
Modal target
`aria-labelledby="[id]"`
Supply the modal's title id here. Assistive technologies use this to catalog the document objects correctly.
Modal target
`role="dialog"`
Identifies dialog elements for assistive technologies.
Modal target
`role="document"`
Helps assistive technologies to switch their reading mode from the larger document to a focused dialog window.
Modal target
## Examples[](#examples)
You can wire up a modal along with the corresponding button by wrapping both in a `s-modal` controller and attaching the corresponding `data-*` attributes. Make sure to set `data-s-modal-return-element` if you want your button to refocus on close.
```html
```
Alternatively, you can also use the built in helper to display a modal straight from your JS file. This is useful for the times when your modal markup can’t live next to your button or if it is generated dynamically (e.g. from an AJAX call).
```html
```
```javascript
document
.querySelector(".js-modal-toggle")
.addEventListener("click", function (e) {
Stacks.showModal(document.querySelector("#modal-base"));
});
```
Launch example modal Launch example modal w/ danger state
# Example title
Nullam ornare lectus vitae lacinia gravida. Donec pretium dui mauris, quis aliquet ipsum pharetra non. Fusce tincidunt felis dui. Morbi sit amet ipsum nisi.
Save changes Cancel
# Example title
Nullam ornare lectus vitae lacinia gravida. Donec pretium dui mauris, quis aliquet ipsum pharetra non. Fusce tincidunt felis dui. Morbi sit amet ipsum nisi.
Save changes Cancel
### Danger state[](#danger-state)
Not every modal is sunshine and rainbows. Sometimes there are potentially drastic things that could happen by hitting a confirm button in a modal—such as deleting an account. In moments like this, add the `.s-modal__danger` class to `.s-modal`. Additionally, you should switch the buttons to `.s-btn__danger`, since the main call to action will be destructive.
```html
```
# Example title
Nullam ornare lectus vitae lacinia gravida. Donec pretium dui mauris, quis aliquet ipsum pharetra non. Fusce tincidunt felis dui. Morbi sit amet ipsum nisi.
Save changes Cancel
### Celebratory[](#celebratory)
Sometimes it’s appropriate to confirm a user’s action with some confetti. You can combine our [confetti background utility](/system/base/backgrounds#confetti) with some extra spacing by adding the `s-modal__celebration` modifier.
```html
```
# Congratulations!
Nullam ornare lectus vitae lacinia gravida. Donec pretium dui mauris, quis aliquet ipsum pharetra non. Fusce tincidunt felis dui. Morbi sit amet ipsum nisi.
Got it!
## Sizes[](#sizes)
Most modal dialogs look good by default, but may need some combination of `.ws[x]` or `.wmx[x]` classes applied to `.s-modal--dialog`. Additionally, the following class is available for modals:
Class
Value
`.s-modal__full`
100% - 48px
---
### Page: Navigation
URL: https://stackoverflow.design/system/components/navigation
Date: 2026-08-13T14:42:34.048Z
description: Our navigation component is a collection of buttons that respond gracefully to various window sizes and parent containers.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-navigation`
Base parent container for navigation.
N/A
N/A
`.s-navigation--item`
The individual item in a navigation.
`.s-navigation`
N/A
`.s-navigation--avatar`
Applies styling to the avatar of the navigation item.
`.s-navigation--item`
N/A
`.s-navigation--icon`
Applies styling to the icon of the navigation item.
`.s-navigation--item`
N/A
`.s-navigation--item-text`
The element meant to contain the text of the navigation item.
`.s-navigation--item`
N/A
`.s-navigation__scroll`
When the navigation items overflow the width of the component, enable horizontal scrolling. By default, navigation items will wrap. This should not be applied to vertical navigations.
N/A
`.s-navigation`
`.s-navigation__sm`
Tightens up the overall spacing and reduces the text size.
N/A
`.s-navigation`
`.s-navigation__vertical`
Renders the navigation vertically.
N/A
`.s-navigation`
`.s-navigation--item__dropdown`
Adds a small caret that indicates a dropdown.
N/A
`.s-navigation--item`
`.is-selected`
Applies to a navigation item that's currently selected / active.
N/A
`.s-navigation--item`
Show All Classes
### Preventing layout shift[](#preventing-layout-shift)
Horizontal layout shift may occur when changing which item is selected within the navigation component. We recommend including the `data-text` attribute on the child navigation item text element with the value duplicating the text of the item to prevent the layout shift. See below for examples.
Item
Description
Applied to
`data-text="[value]"`
Prevents layout shift when changing selected button. Value should be the text of the navigation item.
`.s-navigation--item-text`
## Horizontal[](#horizontal)
Care should be taken to only include at most one primary and one secondary navigation per page. Using multiple navigations with the same style can cause user confusion.
Forcing a navigation to scroll is an established pattern on mobile devices, so it may be appropriate to use it in that context. Wrapping tends to make more sense on larger screens, where the user isn’t forced to scroll passed a ton of navigation chrome.
### Horizontal default[](#horizontal-default)
Use the default size for primary page-level navigation, typically placed near the top of the page.
```html
```
Full width
* [Product
](#)
* [Email
](#)
* [Content
](#)
* [Brand
](#)
* [Marketing
](#)
Wrapped
* [Product
](#)
* [Email
](#)
* [Content
](#)
* [Brand
](#)
* [Marketing
](#)
### Icons[](#icons)
Use the icon variant for a prominent, secondary horizontal navigation bar that directs users to main page sections. Limit use to one per page and do not use it for in-page filtering. Icon styles should change with the state of the item (ex: selected items use a fill icon)
```html
```
* [Content
](#)
* [Topics
](#)
* [People
](#)
* [Settings
](#)
Today
### Scrolling[](#scrolling)
```html
```
* [Product
](#)
* [Email
](#)
* [Content
](#)
* [Brand
](#)
* [Marketing
](#)
### Dropdown[](#dropdown)
```html
```
* [Product
](#)
* [Email
](#)
* [More
](#)
### Small[](#small)
Use the small variant for on-page filtering in space-constrained areas, such as controlling small lists. Avoid using icons on the small variant.
```html
```
* [Product
](#)
* [Email
](#)
* [Content
](#)
* [Brand
](#)
* [Marketing
](#)
## Vertical[](#vertical)
Stacks also provides a vertical variation with support for section headers.
### Vertical default[](#vertical-default)
```html
```
* [Product
](#)
* [Email
](#)
* [Content
](#)
* [Brand
](#)
* [Marketing
](#)
### Vertical Icons[](#vertical-icons)
Vertical navigation items with icons have a larger padding.
```html
```
* [Home
](#)
* [Jobs
New
](#)
* [Saves
3
3 new activities
](#)
* [Users
](#)
### Avatar[](#avatar)
```html
```
* [ Humson Humson](#)
* [ Samson Samson](#)
### Titles[](#titles)
```html
```
* #### Resources
* [Icons
](#)
* [Spot illustrations
](#)
* #### Base
* [Home
](#)
* [Jobs
](#)
* [Saves
](#)
* [Users
](#)
---
### Page: Notices
URL: https://stackoverflow.design/system/components/notices
Date: 2026-08-13T14:42:34.087Z
description: Notices deliver System and Engagement messaging, informing the user about product or account statuses and related actions.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-notice`
Base notice parent class. Use inside \`.s-toast\` when rendered as a toast.
N/A
N/A
`.s-notice--actions`
Container styling for notice actions including the dismiss button.
`.s-notice`
N/A
`.s-notice--dismiss`
Applies to child button element within the notice to position it appropriately.
`.s-notice`
N/A
`.s-notice__activity`
Applies activity (pink) visual styles.
N/A
`.s-notice`
`.s-notice__danger`
Applies danger (red) visual styles.
N/A
`.s-notice`
`.s-notice__featured`
Applies featured (purple) visual styles.
N/A
`.s-notice`
`.s-notice__important`
Applies an important visual style. This should be used for time-sensitive, pressing information that needs to be noticed by the user.
N/A
`.s-notice`
`.s-notice__info`
Applies info (blue) visual styles.
N/A
`.s-notice`
`.s-notice__success`
Applies success (green) visual styles.
N/A
`.s-notice`
`.s-notice__warning`
Applies warning (yellow) visual styles.
N/A
`.s-notice`
`.s-toast`
Parent of \`.s-notice\`. See the Toast section for more information.
N/A
N/A
Show All Classes
## Accessibility[](#accessibility)
Item
Description
Applies to
`aria-labelledby="[id]"`
Used to reference the alert message within the dialog. If you are using \`.s-toast\`, this must be applied.
`.s-toast`
`aria-hidden="[state]"`
Informs assistive technologies if they should ignore the element. When applied to \`.s-toast\`, Stacks will use this attribute to show or hide the toast.
`.s-toast`
`aria-label="[text]"`
Labels the element for assistive technologies. This should be used on any button that does not contain text content.
`.s-btn`
`role="alert"`
A form of live region which contains important, usually time-sensitive, information. Elements with an alert role have an implicit aria-live value of assertive and implicit aria-atomic value of true.
`.s-notice`
`role="alertdialog"`
The wrapping content area of an alert. Elements with the alertdialog role must use the aria-describedby attribute to reference the alert message within the dialog.
`.s-toast`
`role="status"`
A form of live region which contains advisory information but is not important enough to justify an alert role. Elements with a status role have an implicit aria-live value of polite and implicit aria-atomic value of true.
`.s-notice`
Show all accessibility items
## Examples[](#examples)
### Base[](#base)
```html
```
Help Default filled message style `and some code` notice. [Link](#)
Information Info filled message style `and some code` notice. [Link](#)
Success Success filled message style `and some code` notice. [Link](#)
Warning Warning filled message style `and some code` notice. [Link](#)
Danger Danger filled message style `and some code` notice. [Link](#)
Featured Featured filled message style `and some code` notice. [Link](#)
Activity Activity filled message style `and some code` notice. [Link](#)
### Important[](#important)
Used sparingly for when an important notice needs to be noticed
```html
```
Help Default filled message style `and some code` notice. [Link](#)
Information Info filled message style `and some code` notice. [Link](#)
Success Success filled message style `and some code` notice. [Link](#)
Warning Warning filled message style `and some code` notice. [Link](#)
Danger Danger filled message style `and some code` notice. [Link](#)
Featured Featured filled message style `and some code` notice. [Link](#)
Activity Activity filled message style `and some code` notice. [Link](#)
### Styling child links[](#styling-child-links)
We recommend using [descendent anchor](/product/components/links/#descendent-anchors) classes, typically `.s-anchors.s-anchors__inherit.s-anchors__underlined` for notices containing links generated from markdown when you cannot manually generate the inner html.
```html
```
Default
Information Notice with [default link style](#)
.s-anchors .s-anchors\_\_inherit .s-anchors\_\_underlined
Information Notice with [styled link](#)
## Toast[](#toast)
Warning
We are phasing out Toasts due to significant accessibility barriers. Avoid this component for new features. Instead, prioritize integrated alternatives—such as component state changes or inline messages—to provide accessible feedback directly where the user is focused.
Toasts are floating notices that are aligned to the center top of the page. They disappear after a set time. Visibility is changed with animation by toggling between `aria-hidden="true"` and `aria-hidden="false"`. When including a dismiss button the `.s-notice--dismiss` class should be applied to the button for toast-specific styling.
```html
```
Default toast with an undo button.
Undo
Info toast with an undo button.
Undo
### JavaScript[](#javascript)
#### Attributes[](#attributes)
Attribute
Description
Applies to
`data-controller="s-toast"`
Wires up the element to the toast controller. This may be a \`.s-toast\` element or a wrapper element.
Controller element
`data-s-toast-target="toast"`
Wires up the element that is to be shown/hidden.
Controller element
`data-s-toast-target="initialFocus"`
Designates which element to focus on toast show. If absent, defaults to the first focusable element within the toast.
Any child focusable element
`data-action="s-toast#toggle"`
Wires up the element to toggle the visibility of a toast.
Toggling element
`data-s-toast-return-element="[selector]"`
(optional) Designates the element to return focus to when the toast is closed. If left unset, focus is not altered on close.
Controller element
`data-s-toast-remove-when-hidden="true"`
(optional) Removes the toast from the DOM entirely when it is hidden.
Controller element
#### Events[](#events)
Event
Description
Applies to
`s-toast:show`
Fires immediately before showing the toast. Calling \`.preventDefault()\` cancels the display of the toast.
Toast target
`s-toast:shown`
Fires after the toast has been visually shown.
Toast target
`s-toast:hide`
Fires immediately before hiding the toast. Calling \`.preventDefault()\` cancels the removal of the toast.
Toast target
`s-toast:hidden`
Fires after the toast has been visually hidden.
Toast target
#### Event details[](#event-details)
event.detail
Description
Applicable events
`dispatcher`
Contains the Element that initiated the event. For instance, the button clicked to show, the element clicked outside the toast that caused it to hide, etc.
s-toast:\*
`returnElement`
Contains the Element to return focus to on hide. If a value is set to this property inside an event listener, it will be updated on the controller as well.
s-toast:show, s-toast:hide
#### Helpers[](#helpers)
The following helpers are available to manually show and hide a toast notice.
Function
Description
Parameters
`Stacks.showToast`
Helper to manually show an s-toast element via external JS.
element
`Stacks.hideToast`
Helper to manually hide an s-toast element via external JS.
element
---
### Page: Page Titles
URL: https://stackoverflow.design/system/components/page-titles
Date: 2026-08-13T14:42:34.114Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Pagination
URL: https://stackoverflow.design/system/components/pagination
Date: 2026-08-13T14:42:34.114Z
description: Pagination splits content into pages, as seen on questions, tags, users, and jobs listings.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-pagination`
Base pagination style.
N/A
N/A
`.s-pagination--item`
A child element that's used as a link and labeled with the page number.
`.s-pagination`
N/A
`.s-pagination--item__clear`
Clears the background and removes any interactivity. Used for ellipses and descriptions.
N/A
`.s-pagination--item`
`.s-pagination--item__nav`
Styles the Next or Previous button with a circular background and fixed dimensions. Typically used with an icon to indicate navigation to the next page.
N/A
`.s-pagination--item`
`.is-selected`
Active state that's applied to the current page.
N/A
`.s-pagination--item`
## Example[](#example)
```html
```
* [Prev](#)
* [page 1](#)
* [page 2](#)
* [page 3](#)
* [page 4](#)
* [page 5](#)
* …
* [page 122386](#)
* [Next](#)
---
### Page: Popovers
URL: https://stackoverflow.design/system/components/popovers
Date: 2026-08-13T14:42:34.127Z
description: Popovers are small content containers that provide a contextual overlay. They can be used as in-context feature explanations, dropdowns, or tooltips.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-popover`
Base parent container for popovers.
N/A
N/A
`.s-popover--close`
Used to dismiss a popover.
`.s-popover`
N/A
`.s-popover--content`
Wrapper around the popover content to apply appropriate overflow styles.
`.s-popover`
N/A
`.s-popover__tooltip`
Removes minimum size constraints to support shorter tooltip text.
N/A
`.s-popover`
`.is-visible`
This class toggles the popover visibility.
N/A
`.s-popover`
## Interactive popovers[](#interactive-popovers)
Stacks provides a Stimulus controller that allows you to interactively display a popover from a source element. Positioning direction are managed for you by [Popper.js](https://popper.js.org), a powerful popover positioning library we’ve added as a dependency. These popovers are automatically hidden when user click outside the popover or tap the `Esc` key.
### Interactive Attributes[](#interactive-attributes)
Attribute
Description
Applied to
`id="{POPOVER_ID}"`
A unique id that the popover's toggling element can target. Matches the value of \`\[aria-controls\]\` on the toggling element.
`.s-popover`
`data-controller="s-popover"`
Wires up the element to the popover controller. This may be a toggling element or a wrapper element.
Controller element
`data-s-popover-reference-selector="[selector]"`
(optional) Designates the element to use as the popover reference. If left unset, defaults to the controller element.
Controller element
`aria-controls="{POPOVER_ID}"`
Associates the element to the desired popover element.
Reference element
`data-action="s-popover#toggle"`
Wires up the element to toggle the visibility of a generic popover.
Toggling element
`data-s-popover-toggle-class="[class list]"`
Adds an optional space-delineated list of classes to be toggled on the originating element when the popover is shown or hidden.
Controller element
`data-s-popover-placement="[placement]"`
Dictates where to place the popover in relation to the reference element. Defaults to \`bottom\`. Accepted placements are \`auto\`, \`top\`, \`right\`, \`bottom\`, \`left\`, each with optional \`-start\` and \`-end\` variations.
Controller element
`data-s-popover-auto-show="[true|false]"`
(optional) If \`true\`, the popover will appear immediately when the Stacks controller is first connected. Use this instead of \`.is-visible\` to prevent the popover from appearing before it has been correctly positioned.
Controller element
`data-s-popover-hide-on-outside-click="[value]"`
(optional) Default: \`always\`. Values: \`always\` — hides on outside clicks; \`if-in-viewport\` — only hides if the popover is in the viewport; \`never\` — does not hide on outside clicks; \`after-dismissal\` — does not hide on outside clicks unless it has been dismissed at least once.
Controller element
Show all interactive attributes
### Interactive Events[](#interactive-events)
Event
Description
`s-popover:show`
Fires immediately before showing and positioning the popover. Can be used to create or initialize the popover element. Calling \`.preventDefault()\` cancels the display.
`s-popover:shown`
Fires immediately after showing the popover.
`s-popover:hide`
Fires immediately before hiding the popover. Calling \`.preventDefault()\` prevents the removal of the popover.
`s-popover:hidden`
Fires immediately after hiding the popover.
### Dispatched Events[](#dispatched-events)
Event
Description
Element
`dispatcher`
Contains the \`Element\` that initiated the event. For instance, the button clicked to show, the element clicked outside the popover that caused it to hide, etc.
s-popover:\*
## Examples[](#examples)
Show example popover
Username
Password
Sign in [Create an account](#)
Show example popover
There's no data associated with your account yet. Please check back tomorrow.
Link an account
info
We know you hate spam, and we do too. That's why we make it easy for you to update your email preferences or unsubscribe at anytime.
We never share your email address with third parties for marketing purposes.
### Default interactivity[](#default-interactivity)
To enable interactive popovers, you will need to add the above attributes to the popover’s originating button. Custom positioning can be specified using the `data-s-popover-placement`. In the following example, we’ve chosen `bottom-start`. No positioning classes need to be added to your markup, only the data attributes.
To promote being able to tab to an open popover, it’s best to place the popover immediately after the toggling button in the markup as siblings.
```html
…
```
Popover button
Example popover content
### Menu popovers[](#menu-popovers)
Menu popovers are dismissed when keyboard focus leaves the reference and popover. Apply `role="menu"` to the contained menu, or to the `.s-popover` root, to enable this behavior. Generic popovers that keep the default `role="dialog"` stay open when focus moves outside.
```html
```
Default popover
Default action
Menu popover
* Share
* Edit
* Follow
Outside focus target
### Dismissible[](#dismissible)
In the case of new feature callouts, it may be appropriate to include an explicit dismiss button. You can add one using the styling provided by `.s-popover--close`.
In order for to close the popover with an explicit close button, you’ll need to add the controller to a parent as illustrated in the following example code:
```html
…
```
Show dismissible popover
Dismissible persistent popover presented with a close button
### JavaScript interaction[](#javascript-interaction)
There may be cases where you need to show or hide a popover via JavaScript. For example, if you need to show a popover at a specific time or if you need to hide a popover from an event outside of the controller, Stacks provides convenience methods to achieve this.
```javascript
Stacks.application.register(
"section",
class extends Stacks.StacksController {
static targets = ["help"];
showHelp(event) {
Stacks.showPopover(this.helpTarget);
event.stopPropagation();
}
hideHelp(event) {
Stacks.hidePopover(this.helpTarget);
}
}
);
```
# Lorem ipsum
help
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et metus molestie nulla luctus sodales ac luctus justo. Aenean iaculis ac ante sit amet aliquam. Duis dolor velit, imperdiet sed mauris eu, sollicitudin egestas nisl.
### JavaScript configuration (popovers)[](#javascript-configuration-popovers)
Situations may also arise where popovers need to be attached to an element after the document is rendered. For example, a button could have a contextual menu that is too expensive to serve up on every page load.
Popovers can be attached to an element after the fact using `Stacks.attachPopover`.
This method takes three parameters, the element to attach the popover to, the popover either as an element or an HTML string, and optional options for displaying the popover.
```javascript
Stacks.application.register("actions", class extends Stacks.StacksController {
var loaded = false;
async load() {
if (this.loaded) { return; }
Stacks.attachPopover(this.element,
await fetch(`/posts/{postId}/actions`),
{ autoShow: true, toggleOnClick: true });
this.loaded = true;
}
});
```
## Tooltips[](#tooltips)
When a popover is intended only for display as an on-hover tooltip and contains no interactive text, the `s-tooltip` controller can be used in place of `s-popover`. This is a separate controller that can be used alongside `s-popover` on a single target element.
### Tooltip hover attributes[](#tooltip-hover-attributes)
Attribute
Description
Applied to
`id="{POPOVER_ID}"`
A unique id that the popover's toggling element can target. Matches the value of \`\[aria-describedby\]\` on the toggling element.
`.s-popover`
`data-controller="s-tooltip"`
Wires up the element to the tooltip controller.
Controller element
`data-s-tooltip-reference-selector="[selector]"`
(optional) Designates the element to use as the tooltip reference. If left unset, defaults to the controller element.
Controller element
`aria-describedby="{POPOVER_ID}"`
Associates the element to the desired popover element.
Reference element
`title="{TITLE}"`
If \`aria-describedby\` is not present or valid, and the title attribute exists, the title will be removed from the element and used to create a popover immediately after the element. All content will be escaped and inserted as text.
Controller element
`data-s-tooltip-html-title="{TITLE}"`
Acts the same as the \`title\` attribute, but inserts the raw text directly as HTML. If both exist on the element, this attribute takes precedence.
Controller element
`data-s-tooltip-placement="[placement]"`
Dictates where to place the tooltip in relation to the reference element. Defaults to \`bottom\`. Accepted placements are \`auto\`, \`top\`, \`right\`, \`bottom\`, \`left\`, each with optional \`-start\` and \`-end\` variations.
Controller element
Show all tooltip hover attributes
### Tooltip hover events[](#tooltip-hover-events)
Event
Description
Element
`s-tooltip:show`
Fires immediately before showing and positioning the tooltip. Calling \`.preventDefault()\` cancels the display.
Controller element
`s-tooltip:shown`
Fires immediately after showing the tooltip.
Controller element
`s-tooltip:hide`
Fires immediately before hiding the tooltip. Calling \`.preventDefault()\` prevents the removal of the tooltip.
Controller element
`s-tooltip:hidden`
Fires immediately after hiding the tooltip.
Controller element
Show all tooltip hover events
### Tooltip dispatched events[](#tooltip-dispatched-events)
Event
Description
Element
`dispatcher`
Contains the \`Element\` that initiated the event. For instance, the element hovered over to show, etc.
s-tooltip:\*
## Tooltip examples[](#tooltip-examples)
If the user doesn’t need to interact with the _contents_ of the popover, it may be appropriate to only show it on hover. This will make popovers feel like a tooltip. To do so, we provide an alternative controller, `s-tooltip`, that shows the tooltip only on hover.
### Title attribute[](#title-attribute)
In the simple case where no markup is needed in the tooltip, the popover element can be omitted and automatically generated using the `title` attribute.
```html
```
Hover tooltip popover
This popover shows content from the title attribute.
### JavaScript configuration (tooltips)[](#javascript-configuration-tooltips)
In cases where the tooltip needs to display simple text or HTML, the popover can be configured using JavaScript. Plain text tooltips will render characters like <, >, and & as is. HTML tooltips will render the HTML as expected.
```javascript
Stacks.setTooltipText(el, "Plain text tooltip", {
placement: "top-start",
});
Stacks.setTooltipHtml(el, "Tooltip with HTML", {
placement: "top-end",
});
```
### Rich tooltips[](#rich-tooltips)
When a rich tooltip is required, a popover element can be configured in much the same way as an `s-popover` controller, with the most notable difference being the use of `aria-describedby` instead of `aria-controls`.
```html
…
```
Hover tooltip popover
There's no data associated with your account yet. Please visit our [help page](#) for more information.
### Tooltips and interactive popovers[](#tooltips-and-interactive-popovers)
Hover tooltips can be used alongside interactive popovers. Tooltips will not appear when the interactive popover is visible.
```html
…
```
Popover button with tooltip hover
Saved filters
Save custom sorting & filtering for easy access.
View your saved filters
## Manual placement[](#manual-placement)
Warning
Our Stimulus popover controller handles the positioning of popovers for you. Popovers _can_ be positioned manually for various legacy reasons, but we recommend using the `s-popover` controller's `placement` property instead.
### Manual examples[](#manual-examples)
Popovers can also be positioned manually if you aren’t using the built-in JavaScript interactivity. Practically, this might look like adding something like `t8 l8` to `.s-popover`.
By default, popovers are hidden and positioned absolutely. Adding the class `.is-visible` will show the popover.
```html
…
```
Example popover with manual placement
---
### Page: Post summary
URL: https://stackoverflow.design/system/components/post-summary
Date: 2026-08-13T14:42:34.192Z
description: The post summary component summarizes various content and associated meta data into a highly configurable component.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-post-summary`
Base parent container for a post summary.
N/A
N/A
`.s-post-summary--answers`
Container for the post summary answers.
`.s-post-summary`
N/A
`.s-post-summary--content`
Container for the post summary content.
`.s-post-summary`
N/A
`.s-post-summary--stats`
Container for the post summary stats.
`.s-post-summary`
N/A
`.s-post-summary--tags`
Container for the post summary tags.
`.s-post-summary`
N/A
`.s-post-summary--title`
Container for the post summary title.
`.s-post-summary`
N/A
`.s-post-summary--answer`
Container for a post summary answer.
`.s-post-summary--answers`
N/A
`.s-post-summary--content-meta`
A container for post meta data, things like tags and user cards.
`.s-post-summary--content`
N/A
`.s-post-summary--content-type`
Container for the post summary content type.
`.s-post-summary--content`
N/A
`.s-post-summary--excerpt`
Container for the post summary excerpt.
`.s-post-summary--content`
N/A
`.s-post-summary--stats-answers`
Container for the post summary answers stat.
`.s-post-summary--stats`
N/A
`.s-post-summary--stats-bounty`
Container for the post summary bounty stat.
`.s-post-summary--stats`
N/A
`.s-post-summary--stats-item`
A generic container for views, comments, read time, and other meta data which prepends a separator icon.
`.s-post-summary--stats`
N/A
`.s-post-summary--stats-votes`
Container for the post summary votes stat.
`.s-post-summary--stats`
N/A
`.s-post-summary--title-link`
Link styling for the post summary title.
`.s-post-summary--title`
N/A
`.s-post-summary--title-icon`
Icon styling for the post summary title.
`.s-post-summary--title`
N/A
`.s-post-summary--sm-hide`
Hides the element on small screens.
N/A
`.s-post-summary > *`
`.s-post-summary--sm-show`
Shows the element on small screens.
N/A
`.s-post-summary > *`
`.s-post-summary__answered`
Adds the styling necessary for a question with an accepted answer.
N/A
`.s-post-summary`
`.s-post-summary__deleted`
Adds the styling necessary for a deleted post.
N/A
`.s-post-summary`
`.s-post-summary--answer__accepted`
Adds the styling necessary for an accepted answer.
N/A
`.s-post-summary--answer`
Show All Classes
## Examples[](#examples)
### Base[](#base)
Use the post summary component to provide a concise summary of a question, article, or other content.
```html
```
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
### Answered[](#answered)
Add the `.s-post-summary__answered` modifier class to indicate that the post has an accepted answer.
```html
…
```
+24 votes
Has accepted answer 1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
### Bountied[](#bountied)
Include the `.s-post-summary--stats-bounty` element to indicate that the post has a bounty.
```html
…
…
+50 bounty
…
```
+24 votes
1 answer
+ 50 bounty
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
+ 50 bounty
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
### Ignored[](#ignored)
Including an ignored tag will automatically apply custom ignored styling to the post summary.
```html
```
+24 votes
Has accepted answer 1 answer
+ 50 bounty
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
+ 50 bounty
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation
Ignored tag
](#)[langchain](#) [llm](#) [vector-database](#) [ai](#)
### Watched[](#watched)
Including a watched tag will automatically apply custom watched styling to the post summary.
```html
```
+24 votes
Has accepted answer 1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation
Watched tag
](#)[langchain](#) [llm](#) [vector-database](#) [ai](#)
### Deleted[](#deleted)
Include the `.s-post-summary__deleted` modifier class applies custom deleted styling to the post summary.
```html
…
```
+24 votes
Has accepted answer 1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
### State badges[](#state-badges)
Include the appropriate state badge to indicate the current state of the post.
```html
Draft
…
Draft
…
```
+24 votes
1 answer
Draft
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
Draft
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
+24 votes
1 answer
Review
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
Review
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
+24 votes
1 answer
Closed
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
Closed
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
+24 votes
1 answer
Archived
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
Archived
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
+24 votes
1 answer
Pinned
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
Pinned
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
### Content types[](#content-types)
Include the appropriate content type badge to indicate the type of content the post represents.
```html
```
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[Announcement](#)
[retrieval-augmented-generation](#) [langchain](#)
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[How-to guide](#)
[retrieval-augmented-generation](#) [langchain](#)
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[Knowledge article](#)
[retrieval-augmented-generation](#) [langchain](#)
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[Policy](#)
[retrieval-augmented-generation](#) [langchain](#)
### Excerpt sizes[](#excerpt-sizes)
Post summaries can be shown without an excerpt or with an excerpt with one, two, or three lines of text. Exclude the excerpt container to hide the excerpt or apply the appropriate truncation class to the excerpt container. See also [Truncation](/system/base/truncation/).
#### Classes[](#classes-1)
Class
Description
`.v-truncate1`
Truncates the excerpt to 1 line of text.
`.v-truncate2`
Truncates the excerpt to 2 lines of text.
`.v-truncate3`
Truncates the excerpt to 3 lines of text.
#### Examples[](#examples-1)
```html
…
…
…
…
…
…
…
…
…
…
```
No excerpt
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
Small (1 line)
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
Medium (2 lines)
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
Large (3 lines)
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
### Small container[](#small-container)
Post summaries adapt to their container size. When shown with a container smaller than 448px, the post summary renders with a compact layout.
```html
…
```
+24 votes
1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#)
+24 votes
Has accepted answer 1 answer
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#)
+24 votes
1 answer
+ 50 bounty
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
1 answer
+ 50 bounty
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#)
### Answers[](#answers)
Answers to a question can be shown in a post summary. Include the `.s-post-summary--answers` container to show the answers.
For accepted answers, add the `.s-post-summary--answer__accepted` modifier class and display the `Accepted answer` text and icon as shown in the example below.
```html
…
…
…
```
+24 votes
Has accepted answer 2 answers
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
asked 2 hours ago
2026-01-09T12:15:39Z
24
2 answers
98 views
[How to reduce hallucinations and improve source relevance in a RAG pipeline?](#)
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[retrieval-augmented-generation](#) [langchain](#) [llm](#) [vector-database](#)
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
answered 1 hour ago
2026-01-09T13:15:39Z
18
Accepted answer
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
[ SofiaAlc SofiaAlc](#)
* reputation bling 1
answered 1 hour ago
2026-01-09T13:15:39Z
5
I have built a Retrieval-Augmented Generation (RAG) system using LangChain, a vector database, and an open-source LLM. While it works reasonably well, the model often hallucinates answers or cites sources that are only tangentially related to the user's query. My chunking strategy is set to a chunk size of 1000 tokens, which seems to be the sweet spot for the model.
---
### Page: Progress Bars
URL: https://stackoverflow.design/system/components/progress-bars
Date: 2026-08-13T14:42:34.277Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Prose
URL: https://stackoverflow.design/system/components/prose
Date: 2026-08-13T14:42:34.278Z
description: The prose component provides proper styling for rendered Markdown.
Content:
## Parameters[](#parameters)
Class
Description
Parent
Modifies
`.s-prose`
Adds proper styling for rendered Markdown.
N/A
N/A
`.s-prose__sm`
Decreases the base font size and line height.
N/A
`.s-prose`
## Examples[](#examples)
### Minimal[](#minimal)
We modified this test document from the folks at [Tailwind](https://github.com/tailwindcss/typography/blob/master/README.md) to demonstrate and explain our design choices.
Expand example
```html
…
```
Stacks adds a new `s-prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document:
```html
Garlic bread with cheese: What the science tells us
For years parents have espoused the health benefits of eating garlic bread…
```
## What to expect from here on out
What follows from here is just a bunch of absolute nonsense we've written to dogfood the component itself. It includes every sensible typographic element we could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_.
It's important to cover all of these use cases for a few reasons:
1. We want everything to look good out of the box.
2. Really just the first reason, that's the whole point of the plugin.
3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items.
### Typography should be easy
So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable.
Something a wise person once told me about typography is:
> Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad.
It's probably important that images look okay here by default as well:

Now I'm going to show you an example of an unordered list to make sure that looks good, too:
* So here is the first item in this list.
* In this example we're keeping the items short.
* Later, we'll use longer, more complex list items.
## What if we stack headings?
### We should make sure that looks good, too.
Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be.
### When a heading comes after a paragraph…
When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like.
* **I often do this thing where list items have headings.**
For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right.
* **Since this is a list, I need at least two items.**
I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item.
## Code should look okay by default.
Here's what a default `tailwind.config.js` file looks like at the time of writing:
```js
module.exports = {
purge: [],
theme: { extend: {} },
variants: {},
plugins: [],
}
```
Hopefully that looks good enough to you.
## There are other elements we need to style
I almost forgot to mention links, like [Stack Overflow](https://stackoverflow.com).
We even included table styles, check it out:
Wrestler
Origin
Finisher
Bret "The Hitman" Hart
Calgary, AB
Sharpshooter
Stone Cold Steve Austin
Austin, TX
Stone Cold Stunner
Randy Savage
Sarasota, FL
Elbow Drop
We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`.
### Sometimes I even use `code` in headings
Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ approach is the best we've come up with.
### We haven't used an `hr` yet
* * *
We just used one. What do you think? Pretty nice, right?
### Full Markdown spec[](#full-markdown-spec)
This example includes the full kitchen-sink collection of everything the Markdown spec includes.
Expand example
# The Comprehensive Formatting Test
## Code Formatting
* Inline code formatting: `System.out.println("Hello World!");`
* Block code formatting:
```
System.out.println("Hello World!");
System.out.println("Code Block!");
```
```html
```
## Headers
# H1 Header
## H2 Header
### H3 Header
#### H4 Header
##### H5 Header
###### H6 Header
## Emphasis
This is _italic_ and this is **bold**. **_Bold and italic._**
## Lists
### Unordered
* Item one
* Item two
* Nested item A
* Nested item B
* Item three
### Ordered
1. First item
2. Second item
1. Nested first
2. Nested second
3. Third item
## Blockquotes
> This is a blockquote. It can span multiple lines and should be styled appropriately.
>
> It can also have multiple paragraphs.
## Links
Here's a [link to Stack Overflow](https://stackoverflow.com).
## Images

## Tables
Column 1
Column 2
Column 3
Row 1, Col 1
Row 1, Col 2
Row 1, Col 3
Row 2, Col 1
Row 2, Col 2
Row 2, Col 3
## Horizontal Rules
* * *
Content after a horizontal rule.
## Inline elements
This paragraph contains **bold**, _italic_, `inline code`, and a [link](#).
It can also include superscript and subscript text.
## Sizing[](#sizing)
### Small[](#small)
In ancillary content like comments or side-discussions, it may be appropriate to add the small variation.
Expand example
```html
…
```
Stacks adds a new `s-prose` class that you can slap on any block of vanilla HTML content and turn it into a beautiful, well-formatted document:
```html
Garlic bread with cheese: What the science tells us
For years parents have espoused the health benefits of eating garlic bread…
```
## What to expect from here on out
What follows from here is just a bunch of absolute nonsense we've written to dogfood the component itself. It includes every sensible typographic element we could think of, like **bold text**, unordered lists, ordered lists, code blocks, block quotes, _and even italics_.
It's important to cover all of these use cases for a few reasons:
1. We want everything to look good out of the box.
2. Really just the first reason, that's the whole point of the plugin.
3. Here's a third pretend reason though a list with three items looks more realistic than a list with two items.
### Typography should be easy
So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable.
Something a wise person once told me about typography is:
> Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad.
It's probably important that images look okay here by default as well:

Now I'm going to show you an example of an unordered list to make sure that looks good, too:
* So here is the first item in this list.
* In this example we're keeping the items short.
* Later, we'll use longer, more complex list items.
## What if we stack headings?
### We should make sure that looks good, too.
Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be.
### When a heading comes after a paragraph…
When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like.
* **I often do this thing where list items have headings.**
For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right.
* **Since this is a list, I need at least two items.**
I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item.
## Code should look okay by default.
Here's what a default `tailwind.config.js` file looks like at the time of writing:
```js
module.exports = {
purge: [],
theme: { extend: {} },
variants: {},
plugins: [],
}
```
Hopefully that looks good enough to you.
## There are other elements we need to style
I almost forgot to mention links, like [Stack Overflow](https://stackoverflow.com).
We even included table styles, check it out:
Wrestler
Origin
Finisher
Bret "The Hitman" Hart
Calgary, AB
Sharpshooter
Stone Cold Steve Austin
Austin, TX
Stone Cold Stunner
Randy Savage
Sarasota, FL
Elbow Drop
We also need to make sure inline code looks good, like if I wanted to talk about `` elements or tell you the good news about `@tailwindcss/typography`.
### Sometimes I even use `code` in headings
Even though it's probably a bad idea, and historically I've had a hard time making it look good. This _"wrap the code blocks in backticks"_ approach is the best we've come up with.
### We haven't used an `hr` yet
* * *
We just used one. What do you think? Pretty nice, right?
---
### Page: Sidebar widgets
URL: https://stackoverflow.design/system/components/sidebar-widgets
Date: 2026-08-13T14:42:34.293Z
description: Sidebar widgets are flexible containers that provide a lot of patterns that are helpful in a variety of sidebar uses.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-sidebarwidget`
Base sidebar widget style.
N/A
N/A
`.s-sidebarwidget--content`
Container for the sidebar widget content.
`.s-sidebarwidget`
N/A
`.s-sidebarwidget--header`
Container for the sidebar widget header.
`.s-sidebarwidget`
N/A
`.s-sidebarwidget--footer`
Container for the sidebar widget footer.
`.s-sidebarwidget`
N/A
## Basic style[](#basic-style)
In its simplest form, `.s-sidebarwidget` is comprised of a `.s-sidebarwidget--content` section and optional `.s-sidebarwidget--header` and `.s-sidebarwidget--footer` sections. Together these classes create a widget with appropriate inner spacing for you to put whatever you want into it.
Information
By default the content is a flex container. If you require `display: block` instead, add the `d-block` class.
Warning
The examples of `s-sidebarwidget--header` are shown with `h2` elements, but the appropriate heading level may differ depending on context. Please use the appropriate heading level for your context to ensure heading levels only increase by 1.
```html
```
## Community Achievements
[Track](#)
You've earned 3 new badges this week! Keep contributing to unlock more achievements and privileges within the community. View all badges
See your progress
---
### Page: Tables
URL: https://stackoverflow.design/system/components/tables
Date: 2026-08-13T14:42:34.296Z
description: Tables are used to list all information from a data set. The base style establishes preferred padding, font-size, and font-weight treatments. To enhance or customize the look of the table, apply any additional classes listed below.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-table-container`
Container for the table.
N/A
N/A
`.s-table`
Base table style.
`.s-table-container`
N/A
`.s-table--cell:n`
Table cell width in 12 evenly divided columns. Replace \`:n\` with the number of columns the cell should span.
`.s-table > tr > td`
N/A
`.s-table__b0`
Removes all table cell borders.
N/A
`.s-table`
`.s-table__bx`
Shows only horizontal table cell borders. Good for tables with lots of data that can be sorted and filtered.
N/A
`.s-table`
`.s-table__bx-simple`
Removes most of the default borders and backgrounds. Good for tables without much data that don't need to be sorted or filtered.
N/A
`.s-table`
`.s-table__sortable`
Applies styling to imply the table is sortable.
N/A
`.s-table`
`.s-table__stripes`
Apply zebra striping to the table.
N/A
`.s-table`
`.s-table__sm`
Apply a condensed sizing to the table.
N/A
`.s-table`
`.s-table__lg`
Apply a large sizing to the table.
N/A
`.s-table`
## Default style[](#default-style)
Tables should be wrapped in a container, `.s-table-container`. This provides horizontal scrolling when necessary in the smallest breakpoints. The default table style is a bordered cell layout with a stylized header row.
```html
```
Name
Username
Joined
Last seen
Aaron Shekey
aaronshekey
Dec 1 '17 at 20:24
just now
Joshua Hynes
joshuahynes
Feb 12 at 18:47
Aug 10 at 14:57
Piper Lawson
piperlawson
Jul 5 at 14:32
Aug 14 at 12:41
## Borders & backgrounds[](#borders--backgrounds)
By default, tables are outlined, have borders on all cells, and have a styled header. Depending on the size and complexity of a table, these can all be configured.
### Horizontal borders[](#horizontal-borders)
Shows only horizontal table cell borders. Good for tables with lots of data that can be sorted and filtered.
```html
…
```
First name
Last name
Username
1
Aaron
S.
@aarons
2
Joshua
H.
@joshuah
3
Paweł
L.
@pawełl
4
Ted
G.
@so-ted
### Simple borders[](#simple-borders)
Removes most of the default borders and backgrounds. Good for tables without much data that don’t need to be sorted or filtered.
```html
…
```
First name
Last name
Username
1
Aaron
S.
@aarons
2
Joshua
H.
@joshuah
3
Paweł
L.
@pawełl
4
Ted
G.
@so-ted
### No borders[](#no-borders)
Removes all table cell borders.
```html
…
```
First name
Last name
Username
1
Aaron
S.
@aarons
2
Joshua
H.
@joshuah
3
Paweł
L.
@pawełl
4
Ted
G.
@so-ted
### Zebra striping[](#zebra-striping)
When tables have a lot of information, you can help users group information and isolate data by adding zebra striping.
```html
…
```
First Name
Last Name
Username
1
Aaron
S.
@aarons
2
Joshua
H.
@joshuah
3
Paweł
L.
@pawełl
4
Ted
G.
@so-ted
## Spacing[](#spacing)
A table’s padding can be changed to be more or less condensed.
### Small[](#small)
```html
…
```
First Name
Last Name
Username
1
Aaron
S.
@aarons
2
Joshua
H.
@joshuah
### Default[](#default)
```html
…
```
First Name
Last Name
Username
1
Paweł
L.
@pawełl
2
Ted
G.
@so-ted
### Large[](#large)
```html
…
```
First Name
Last Name
Username
1
Aaron
S.
@aarons
2
Joshua
H.
@joshuah
## Cell widths[](#cell-widths)
Table columns will size themselves based on their content. To set a specific width, you can use one of the following table cell classes to specify the width for any column.
### Classes[](#classes-1)
Class
Width
`.s-table--cell1`
8.3333333%
`.s-table--cell2`
16.6666667%
`.s-table--cell3`
25%
`.s-table--cell4`
33.3333333%
`.s-table--cell5`
41.6666667%
`.s-table--cell6`
50%
`.s-table--cell7`
58.3333333%
`.s-table--cell8`
66.6666667%
`.s-table--cell9`
75%
`.s-table--cell10`
83.3333333%
`.s-table--cell11`
91.6666667%
`.s-table--cell12`
100%
### Examples[](#examples)
```html
// Example 1
…
…
// Example 2
…
…
…
…
…
// Example 3
…
…
…
…
…
…
```
**.s-table--cell2**
_No Class_
**.s-table--cell3**
**.s-table--cell6**
_No Class_
_No Class_
_No Class_
**.s-table--cell4**
_No Class_
_No Class_
_No Class_
_No Class_
**.s-table--cell2**
## Alignment[](#alignment)
### Vertical alignment[](#vertical-alignment)
The default vertical alignment is `middle`. You change a table’s or a specific cell’s vertical alignment by using the [Vertical Alignment atomic classes](/system/base/vertical-alignment#classes).
```html
…
…
…
…
…
…
```
.va-top
.va-middle
.va-bottom
.s-table.va-bottom
.s-table.va-bottom
.s-table.va-bottom
### Text alignment[](#text-alignment)
Text alignment can be changed at a table or cell level by using [atomic text alignment classes](/system/foundation/typography#layout-classes). Columns containing copy should be left-aligned. Columns containing numbers should be right-aligned.
```html
…
…
…
…
…
…
```
.ta-left
.ta-center
.ta-right
.s-table.ta-right
.s-table.ta-right
.s-table.ta-right
## Sortable tables[](#sortable-tables)
To indicate that the user can sort a table by different columns, add the `s-table__sortable` class to the table.
The `
` cells should include arrows to indicate sortability or the currently applied sorting. In addition, the column that is currently sorted should be indicated with the `is-sorted` class on its `
`.
```html
…
…
```
[Listing](#)
[Status](#)
Owner
Views
Applies
Site Reliability Engineer, Generalist
Sydney, Australia
Running
Sansa Stark
502
13
Senior Product Designer
New York, NY, USA
Running
Robert Baratheon
900
15
Product Manager, Developer Products
London, England
Running
Sansa Stark
3
1
### JavaScript sorting[](#javascript-sorting)
Stacks provides built-in functionality for letting the user sort a table by the values in a column through clicking the column header. This requires the complete data to already exist in the table (e.g. it is not going to work if the table is paged and requires a call to the server to update data on sorting). See the [JavaScript introduction](/system/develop/javascript) for general information about JS in Stacks.
To make your table user-sortable, do the following:
1. Style the table as sortable as explained in the section above.
2. Set `data-controller="s-table"` on the `
` element.
3. Set `data-s-table-target="column"` and `data-action="click->s-table#sort"` on each of the `
` elements that control sorting.
4. Add the three icons for showing _ascending sort_, _descending sort_, and _unsorted_ to each of these header cells, hiding the first two with a `d-none` class. Add the `js-sorting-indicator` class to each of the icons, and add `js-sorting-indicator-asc`, `js-sorting-indicator-desc`, and `js-sorting-indicator-none` to the appropriate icon.
**Note:** Using `js-…` classes is not really the optimal way of doing this, and will probably be replaced with something better eventually. When that happens, the `js-…` mechanism will be deprecated but continue to be supported for a while, so you have ample time to update things.
By default, the data is sorted by the content of the cell. If you need to use a different value, for example because your cell contains a human-readable date, add a `data-s-table-sort-val` attribute to the cell.
If a column contains any data that is not an integer, the data will be sorted lexicographically. Otherwise it will be sorted numerically, with empty cells being considered the lowest number.
If the table contains rows that should not be sorted, but rather always be at the top or always be at the bottom, add `data-s-table-sort-to="top"` or `data-s-table-sort-to="bottom"` to the `
` element.
### JavaScript data attributes[](#javascript-data-attributes)
Attribute
Description
Applies to
`data-controller="s-table"`
Wires up the table to the JS controller.
table
`data-s-table-target="column"`
Marks this as a sortable column for the purpose of modifying arrow icons.
th
`data-action="click->s-table#sort"`
Causes a click on the header cell to sort by this column.
button
`data-s-table-sort-to="top"`
Forces the sorting of a row to the top.
tr
`data-s-table-sort-to="bottom"`
Forces the sorting of a row to the bottom.
tr
`data-s-table-sort-val="[x]"`
Optionally use a custom value for sorting instead of the cell's text content.
td
### JavaScript example[](#javascript-example)
```html
…
Winter
December
2
Spring
March
13
Summer
June
25
Fall
September
13
Average temperature
13
```
Season
Starts in month
Typical temperature in °C
Winter
December
2
Spring
March
13
Summer
June
25
Fall
September
13
Average temperature
13
## Bulk actions[](#bulk-actions)
Generally for a checkbox input that’s placed first in the table row for bulk actions.
```html
…
…
```
bulk checkbox
Display Name
Full Name
Email
bulk checkbox
SansaStark
Sansa Stark
sstark@company.com
bulk checkbox
RobertBaratheon
Robert Baratheon
rbaratheon@company.com
bulk checkbox
Test Developer To Be Is Not A Developer Yet
Test Developer To Be Is Not A Developer Yet
testdevelopertobeisnotadevyet@team-mgmt.dev.company.com
## Totals row[](#totals-row)
Used mainly with data tables, the totals row increases the font-size for all cells within a row.
```html
…
…
```
Listing
Views
Apps
App CTR
Site Reliability Engineer, Generalist
6,871
187
5.02%
Senior Product Designer
2,242
196
16.46%
Product Manager, Developer Products
3,469
229
14.9%
Totals
12,582
612
14.65%
## Inactive rows[](#inactive-rows)
For tables that include inactive or disabled rows, such as inactive users or teams, `.is-disabled` can be applied to any `
`. Additionally, `.is-enabled` can be applied to any `
` or `
` that you’d like to ignore the parent disabled styling (such as a persistent link to reactivate a disabled account).
```html
```
Name
Email
Last seen
Aaron Shekey
emailaddress@website.com
just now
Remove
Joshua Hynes
emailaddress@website.com
Sep 28 '18
Add
Paweł Ludwiczak
emailaddress@website.com
Apr 17 '19
Add
Piper Lawson
emailaddress@website.com
Yesterday
Remove
Ted Goas
emailaddress@website.com
5min ago
Remove
## Atomic classes[](#atomic-classes)
Further control of table behavior is possible with atomic classes. For example, you can make non-table markup display as a table layout by pairing `.d-table`, `.d-table-cell` and `.tl-fixed`.
Class
Output
`.tl-auto`
table-layout: auto;
`.tl-fixed`
table-layout: fixed;
---
### Page: Tags
URL: https://stackoverflow.design/system/components/tags
Date: 2026-08-13T14:42:34.394Z
description: Tags are an interactive, community-generated keyword that allow communities to label, organize, and discover related content. Tags are maintained by their respective communities.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-tag`
Base tag style that is used almost universally.
N/A
N/A
`.s-tag--dismiss`
For a clear or dismiss action icon. When using this element, it should be rendered as a \`button\` containing the icon and the parent \`.s-tag\` should be rendered as a \`span\` element.
`.s-tag`
N/A
`.s-tag--sponsor`
Correctly positions a tag's sponsor logo.
`.s-tag`
N/A
`.s-tag__moderator`
Exclusively used within Meta communities by moderators (and employees) to assign unique statuses to questions.
N/A
`.s-tag`
`.s-tag__required`
Exclusively used within Meta communities to denote the post type. One of these tags are required on all Meta posts.
N/A
`.s-tag`
`.s-tag__ignored`
Prepends an icon to indicate the tag is ignored.
N/A
`.s-tag`
`.s-tag__watched`
Prepends an icon to indicate the tag is watched.
N/A
`.s-tag`
`.s-tag__sm`
Apply a small size to the tag.
N/A
`.s-tag`
`.s-tag__lg`
Apply a large size to the tag.
N/A
`.s-tag`
## Accessibility[](#accessibility)
Tags should be focusable and navigable with the keyboard. The various tag states (Required, Moderator, Watched, Ignored) are visually distinct but do not include any text indicators for screen readers. For that reason it is recommended to provide additional context using hidden text elements with the `v-visible-sr` class.
## Examples[](#examples)
### Default tag[](#default-tag)
```html
……
…
…
```
[jquery](#) javascript Dismiss tag [ android
Sponsored tag
Sponsored tag
](#)[javascript](#) Dismiss tag
### Moderator[](#moderator)
```html
status-completed
```
[status-completed
Moderator tag
Moderator tag
](#)status-bydesign
Moderator tag
Moderator tag
Dismiss tag [status-planned
Moderator tag
Moderator tag
](#)
### Required[](#required)
```html
discussion
```
[discussion
Required tag
Required tag
](#)feature-request
Required tag
Required tag
Dismiss tag [bug
Required tag
Required tag
](#)
### Watched[](#watched)
```html
asp-net
```
[netscape
Ignored tag
Ignored tag
](#)
## Sizes[](#sizes)
```html
csscsscss
```
Example
Modifier class
Description
[css](#)
`.s-tag__sm`
Apply a small size to the tag.
[css](#)
N/A
The default tag size.
[css](#)
`.s-tag__lg`
Apply a large size to the tag.
---
### Page: Toggle switch
URL: https://stackoverflow.design/system/components/toggle-switch
Date: 2026-08-13T14:42:34.412Z
description: A toggle is used to quickly switch between two or more possible states. They are most commonly used for simple "on/off" switches.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-toggle-switch`
Base toggle switch style.
N/A
N/A
`.s-toggle-switch__multiple`
Used to style toggle switches with three or more options.
N/A
`.s-toggle-switch`
## Styles[](#styles)
### Basic toggle[](#basic-toggle)
Toggle switches take up less space than an “on/off” radio button group and communicate their intended purpose more clearly than a checkbox that toggles functionality. They also provide consistency between desktop and mobile experiences.
```html
```
Default
Checked
Disabled
Checked and disabled
### Two or more options with icons[](#two-or-more-options-with-icons)
Toggles switches can be extended to choose between two or more states where each state is represented by an icon. Using the `__multiple` toggle instead of a radio group and making sure labels follow their inputs in this case is important.
```html
```
Search Style
Export Type
---
### Page: Topbar
URL: https://stackoverflow.design/system/components/topbar
Date: 2026-08-13T14:42:34.418Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: Uploader
URL: https://stackoverflow.design/system/components/uploader
Date: 2026-08-13T14:42:34.427Z
description:
Content:
Warning
This component has been removed in Stacks v3. If using Stacks v2, please refer to the [v2 documentation](https://v2.stackoverflow.design/product/develop/using-stacks/) for more information.
---
### Page: User cards
URL: https://stackoverflow.design/system/components/user-cards
Date: 2026-08-13T14:42:34.427Z
description: User cards are a combination of a user and metadata about the user or post
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-user-card`
Base user card container that applies the basic style.
N/A
N/A
`.s-user-card--column`
A container for column elements.
`.s-user-card`
`.s-user-card--row`
A container for row elements.
`.s-user-card`
`.s-user-card--group`
A container for group elements.
`.s-user-card`
`.s-user-card--bio`
Container for the user's bio.
N/A
N/A
`.s-user-card--recognition`
Container for recognition by a collective.
N/A
N/A
`.s-user-card--rep`
Container for the user's reputation.
N/A
N/A
`.s-user-card--time`
Container for the user's timestamp.
N/A
N/A
`.s-user-card--username`
Container for the user's username.
N/A
N/A
`.s-user-card--group__split`
Inserts a separator between each element.
N/A
`.s-user-card--group`
`.s-user-card__sm`
Use the small variant for space-constrained areas, such as post summaries, or to establish visual hierarchy for secondary content like comments and replies.
N/A
`.s-user-card`
`.s-user-card__lg`
Use the large variant when space permits and more detailed information is desired.
N/A
`.s-user-card`
`.s-user-card--username__op`
Identifies the author of the primary post when they appear in secondary contexts, like comment threads.
N/A
`.s-user-card--username`
`.s-user-card__deleted`
When a user is deleted, we still need to show their name, but we strip the metadata.
N/A
`.s-user-card`
`.s-user-card--recognition-additional-bling`
This label appears within a Collective question post to signal that they are a Recognized Member.
N/A
N/A
Show All Classes
## Examples[](#examples)
### Default[](#default)
The base style is the standard variant used to connect a user to their content, appearing most frequently in post-summary lists and on question pages. This view is flexible, allowing various metadata fields to be shown or hidden as needed.
Information
**Note on timestamps:** Hovering over the timestamp displays a popover with precise dates and a link to the post's /timeline. For authors, this shows the post creation date; for editors, it shows the last modification date.
```html
```
[ Community](#)
Bot
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
[ SofiaAlc](#)
Mod
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
[ SofiaAlc](#)
Staff Mod
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
[ SofiaAlc](#)
Mod
* reputation bling 1,775
* gold bling
* silver bling
* bronze bling
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
[ SofiaAlc](#)
Staff Mod
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
### Sizes[](#sizes)
Class
Description
Size
`.s-user-card__sm`
Use the small variant for space-constrained areas, such as post summaries, or to establish visual hierarchy for secondary content like comments and replies.
small
`N/A`
Use the default variant when the user needs a more primary focus of the content. This style features a larger avatar to establish top-level hierarchy like question and answer authors.
N/A
`.s-user-card__lg`
Use the large variant when space permits and more detailed information is desired.
large
#### Small[](#small)
Use the small variant for space-constrained areas, such as post summaries, or to establish visual hierarchy for secondary content like comments and replies. Note that the small variant does not include an avatar size modifier.
```html
```
[ SofiaAlc](#) [asked 2 hr ago](# "2026-01-09 12:15:39Z")
[ SofiaAlc](#)
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
[ SofiaAlc](#)
Mod
[asked 2 hr ago](# "2026-01-09 12:15:39Z")
#### Large[](#large)
Use the large variant when space permits and more detailed information is desired. The large variant uses a different structural layout with `s-user-card--row` and `s-user-card--column` to accommodate an expanded avatar and additional profile details.
```html
```
[](#)
[SofiaAlc](#)
Mod
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
Recognized by [AudioBubble](#)
* Senior Product Designer
* Vancouver, Canada
Developer who believes in clean code, clear coffee, and the occasional snake pun. Automating the boring stuff one script at a time.
[](#)
[SofiaAlc](#)
* reputation bling 1
* Vancouver, Canada
Developer who believes in clean code, clear coffee, and the occasional snake pun. Automating the boring stuff one script at a time.
[](#)
[SofiaAlc](#)
* reputation bling 1
* gold bling 8
* silver bling 12
* bronze bling 4
### States[](#states)
Class
Description
State
`.s-user-card--username__op`
This label identifies the author of the primary post (such as the Question asker) when they appear in secondary contexts, like comment threads.
Original Poster
`N/A`
This label appears on a user's first-ever question or answer to signal that they are new to the platform.
New Contributor
`.s-user-card__deleted`
When a user is deleted, we still need to show their name, but we strip the meta data.
Deleted user
#### Original Poster[](#original-poster)
This label identifies the author of the primary post (such as the Question asker) when they appear in secondary contexts, like comment threads.
```html
```
[ SofiaAlc](#)
New
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
[asked 2 hr ago](# "Show activity on this post")
[ SofiaAlc](#)
New
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
[asked 2 hr ago](# "Show activity on this post")
[ SofiaAlc](#)
New Staff
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
[asked 2 hr ago](# "Show activity on this post")
#### Deleted user[](#deleted-user)
When a user is deleted, we still need to show their name, but we strip the metadata.
```html
…
```
 SofiaAlc
[asked 2 hr ago](# "Show activity on this post")
 SofiaAlc
[asked 2 hr ago](# "Show activity on this post")
### Additional bling[](#additional-bling)
Use to display a specialized icon alongside the username, highlighting unique achievements. This style is additive and can be combined with any of the usercard variants listed above.
Class
Description
Name
`.s-user-card--recognition-additional-bling`
This label appears within a Collective question post to signal that they are a Recognized Member.
Recognized Member
`N/A`
This icon appears next to a user when they are within the top 3 positions of a Collective's leaderboard.
Awarded
#### Recognized Member[](#recognized-member)
```html
```
[ SofiaAlc](#) [](# "This user is ranked #1 on the weekly R Language leaderboard.")[asked 2 hr ago](# "Show activity on this post")
[ SofiaAlc](#)[](# "This user is ranked #2 on the weekly R Language leaderboard.")
* reputation bling 1,775
* gold bling
* silver bling
* bronze bling
[asked 2 hr ago](# "Show activity on this post")
[ SofiaAlc](#)
Mod
[](# "This user is ranked #3 on the weekly R Language leaderboard.")
* reputation bling 1,775
* gold bling 8
* silver bling 12
* bronze bling 4
[asked 2 hr ago](# "Show activity on this post")
---
### Page: Vote
URL: https://stackoverflow.design/system/components/vote
Date: 2026-08-13T14:42:34.473Z
description: The vote component allows users to vote on the quality of content by casting an upvote or downvote.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-vote`
Base vote component.
N/A
N/A
`.s-vote--btn`
Vote button.
`.s-vote`
`.s-vote--votes`
Container for vote counts.
`.s-vote`
`.s-vote--downvotes`
Downvote count.
`.s-vote--votes`
`.s-vote--total`
Total vote count.
`.s-vote--votes`
`.s-vote--upvotes`
Upvote count.
`.s-vote--votes`
`.s-vote__expanded`
Expanded vote style that shows upvote and downvote counts separately.
N/A
`.s-vote`
`.s-vote__horizontal`
Horizontal vote style that arranges buttons and counts in a row. This layout does not officially support downvoting or expanded vote count.
N/A
`.s-vote`
## Examples[](#examples)
### Base[](#base)
The base vote component includes an upvote button, a downvote button, and a vote count. When the vote count is zero and the current user has not voted, it should display `Vote` in place of a number. Otherwise, show the vote count and truncate large numbers (e.g., 1.2k).
```html
12
```
Base
upvote 12 downvote
0 vote count
upvote Vote downvote
≥ 1,000 votes
upvote 27.5K downvote
### Expanded[](#expanded)
Include the `.s-vote__expanded` modifier to show upvote and downvote counts instead of the total vote count. This modifier hides `.s-vote--total` and shows `.s-vote--upvotes` and `.s-vote--downvotes` instead.
```html
+1220-8
```
upvote +12 20 \-8 downvote
### Horizontal[](#horizontal)
Apply the `.s-vote__horizontal` modifier to arrange the vote buttons and counts in a horizontal layout. This layout does not officially support expanded vote count. This configuration is best suited for scenarios such as comment voting, where a more compact design is preferred.
```html
10
```
upvote 5
upvote 10 downvote
### Voted[](#voted)
Use filled vote icons to indicate when the current user has upvoted or downvoted the content.
```html
12
```
Upvoted
upvoted 27.5K downvote
Downvoted
upvote 11 downvoted
Horizontal upvoted
upvoted 6
Horizontal downvoted
upvote 4 downvoted
---
## Collection: develop
### Page: Building Stacks
URL: https://stackoverflow.design/system/develop/building
Date: 2026-08-13T14:42:34.490Z
description: The following is a guide to building and running Stacks locally. You'll need to be able to build Stacks to contribute to our documentation or add new classes to our CSS library.
Content:
## Clone the repo[](#clone-the-repo)
There are two common ways to [clone a repo](https://help.github.com/articles/cloning-a-repository/):
* Use the command line: `git clone https://github.com/StackExchange/Stacks.git`
* Use GitHub’s desktop app.
1. Download and install [GitHub Desktop](https://desktop.github.com).
2. Login with your GitHub credentials.
3. Clone the Stacks repo.
## Get Node and NPM installed[](#get-node-and-npm-installed)
We use a bunch of NPM dependencies to process and package up Stacks for delivery. You’ll need to install them.
1. Install [Node & NPM](https://nodejs.org/en/download/)
2. Open the Stacks repo in a Terminal window.
3. Install the NPM dependencies. `npm install`
## Running Stacks[](#running-stacks)
That should do it for all our dependencies. You’re now able to run Stacks.
1. From the top level of the Stacks repo, run `npm start` or `npm run dev -w packages/stacks-docs`.
2. Visit your local copy of Stacks at [`http://localhost:5173/`](http://localhost:5173/).
## Getting help[](#getting-help)
Installing dependencies can be frustrating, and we’re here to help. If you’re stuck, the Stacks team is always available in #stacks. If that doesn’t work, try [opening an issue](https://github.com/StackExchange/Stacks/issues/new).
---
### Page: Conditional classes
URL: https://stackoverflow.design/system/develop/conditional-classes
Date: 2026-08-13T14:42:34.492Z
description: Stacks provides conditional atomic classes to easily build complex responsive designs, hover states, and print layouts. A limited selection of conditional classes are available throughout Stacks. These are represented in class definitions tables by a green checkmark ✓.
Content:
## Responsive[](#responsive)
Many utility classes in Stacks are also available in screen-size specific variations. For example, the `.d-none` utility can be applied to small browser widths and below using the `.sm:d-none` class, on medium browser widths and below using the `.md:d-none` class, and on large browser widths and below using the `.lg:d-none` class.
This is done using predefined max-width media query breakpoints represented by t-shirt sizes. A common example would be to apply `.md:fd-column` to a flex layout. This means, “At the medium breakpoint and smaller, switch the flex layout from columns to rows by applying `fd-column`.”
> **Note:** Our font size classes, `.fs-[x]` are automatically adjusted at the smallest breakpoint.
### Responsive classes[](#responsive-classes)
Class
Breakpoint
Definition
`.[x]`
N/A
The class is applied on all browser widths.
`.lg:[x]`
1264px
The class is applied on large browser widths and below.
`.md:[x]`
980px
The class is applied on medium browser widths and below.
`.sm:[x]`
640px
The class is applied on small browser widths and below.
### Responsive example[](#responsive-example)
Resize your browser to see which classes are applied.
```html
…
```
## Hover[](#hover)
Stacks provides hover-only atomic classes. By applying `.h:bs-lg`, `.h:o100`, and `.h:fc-black-600`, you’re saying “On hover, add a large box shadow, an opacity of 100%, and a font color of black 900.”
```html
```
## Focus[](#focus)
Stacks provides focus-only atomic classes. By applying `.f:o100`, and `.f:fc-black-600`, you’re saying “On focus, add an opacity of 100%, and a font color of black 900.”
```html
```
## Print[](#print)
Stacks provides print-only atomic classes. By applying `.print:d-none`, you’re saying “In print layouts, remove this element from the layout.”
```html
```
## Dark mode[](#dark-mode)
Stacks provides darkmode-only atomic classes. By applying `.d:bg-green-300`, you’re saying “In dark mode, apply a background of green 100.”
```html
```
In addition to specific overrides, you can force an element’s colors to be light or dark by applying `.theme-dark__forced` or `.theme-light__forced`. This comes in handy when showing users a preview of light or dark interface elements.
```html
```
---
### Page: JavaScript
URL: https://stackoverflow.design/system/develop/javascript
Date: 2026-08-13T14:42:34.495Z
description: This is an introduction to the JavaScript functionality provided by Stacks.
Content:
## Including the Stacks JavaScript[](#including-the-stacks-javascript)
While Stacks is first and foremost a CSS library, it also provides commonly used functionality for some components via JavaScript. This functionality is optional. If you only need the styling parts of Stack, you’re free to ignore the provided JavaScript. The converse is not true: The JavaScript components work under the assumption that the Stacks CSS is available.
Stacks JavaScript is currently included within various Stack Overflow projects automatically. If you’re working on a Stack Overflow project, chances are it’s already available for you! If not, reach out to us and we’ll work on getting it setup.
To include Stacks JavaScript in other projects, do the following.
* Include the file `dist/js/stacks.min.js` in your page. For example, if you use the unpkg CDN, add the tag `` to your HTML. See [Using Stacks](/system/develop/using-stacks) for more information on Unpkg and installing Stacks via NPM.
## Using the Stacks JavaScript[](#using-the-stacks-javascript)
The Stacks JavaScript components are provided as Stimulus controllers. [Stimulus](https://stimulus.hotwired.dev/) is a library created by [Basecamp](https://basecamp.com).
Stimulus allows you to add functionality to your markup in a way that is similar to how you add styling to your markup: by modifying HTML attributes.
Just as you style components by adding classes to the `class` attribute, with Stacks JavaScript, you’ll give components optional functionality by adding `data-…` attributes to the HTML.
The basic functional unit of Stimulus, and of a Stacks JavaScript component, is a **controller**. Controllers are identified by their name, and all Stacks-provided controller names are prefixed with `s-…`, just like component CSS classes. You give functionality to an HTML element by setting its `data-controller` attribute.
```html
```
Refer to the documentation of individual components on how to configure a component’s behavior.
## Creating your own Stimulus controllers[](#creating-your-own-stimulus-controllers)
A side effect of including the Stacks JavaScript in your project is that you also have Stimulus available in your page. This means you can not only use Stacks-provided controllers, but also create your own.
For general information about writing code with Stimulus, refer to the [official documentation](https://stimulusjs.org/handbook/introduction). That documentation generally assumes that you’re writing ES6 code. In order to make it useful without ES6-to-ES5 transpilation, Stacks provides a helper that allows you to write controllers using old-fashioned JavaScript syntax.
This helper is called `Stacks.addController` and takes two arguments: The name (“identifier”) of the controller, and an object that is analogous to the ES6 class that you would write for your controller, except that it’s a plain JavaScript object. All own enumerable properties of that object will be made available on the controller prototype, with the exception of the `targets` property, which will be available on the controller constructor itself, i.e. statically.
With that, you can create and register the final [Hello World controller example](https://stimulusjs.org/handbook/hello-stimulus#controllers-simplify-refactoring) from the official documentation like this:
```javascript
Stacks.addController("greeter", {
targets: ["name"],
greet: function () {
console.log("Hello, " + this.name + "!");
},
get name() {
return this.nameTarget.value;
},
});
```
## JavaScript classnames[](#javascript-classnames)
We prefix our JavaScript target classes with `.js-` so that changing or adding a class name for styling purposes doesn’t inadvertently break our JS. This allows us to style elements with any chain of atomic or component classes from Stacks without breaking any additional JavaScript interactivity.
We also try to avoid IDs for _both_ visual styling and JavaScript targeting. They aren’t reusable, visual styling can’t be overwritten by atomic classes, and, like non-`.js-` classes, we can’t tell if there is JavaScript interactivity attached at a glance.
### Do
```html
```
```js
var button = document.querySelector('#card');
button.addEventListener('click', function() {
…
});
```
```css
#card {
…
}
```
---
### Page: Using Stacks
URL: https://stackoverflow.design/system/develop/using-stacks
Date: 2026-08-13T14:42:34.507Z
description: A short guide to Stacks, a robust CSS & JavaScript Pattern library for rapidly building Stack Overflow.
Content:
## Goals[](#goals)
Stacks is built with a unified goal: We should be writing _as little CSS & JavaScript as possible_. To achieve this goal, the Stacks team has created a robust set of reusable components. These include components like buttons, tables, and form elements.
We’ve also created a powerful set of atomic classes that can be chained together to create just about _any_ layout without writing a single line of _new_ CSS. Further, these atomic classes can be used as modifiers of pre-existing components.
## Installing[](#installing)
Stacks is currently included within various Stack Overflow projects automatically. If you’re working on a Stack Overflow project, chances are it’s already available for you! If not, reach out to us and we’ll work on getting it set up.
To include Stacks in other projects, you can install Stacks via NPM: `npm install --save @stackoverflow/stacks`
You can also include a minified, compiled Stacks CSS style sheet that’s delivered via Unpkg, a CDN for NPM packages. This is good for things like Codepen or other quick prototypes. This CDN should not be considered production-ready. ``
To use Stack’s built-in JavaScript interactivity with your components, refer to the [JavaScript guidelines](/system/develop/javascript/).
Warning
**Warning:** If you're hotlinking to Stacks on the Stack Overflow CDN, **you are doing it wrong**. You are setting yourself up for breaking upstream changes. Instead, you should install via properly versioned package management like NPM. This will keep you pinned to a stable version.
## How to best use Stacks[](#how-to-best-use-stacks)
In order to use Stacks, let’s consider the design you’d like to implement.
1. **My design uses existing components**
Identify if the design you’re implementing uses any existing components. Great, it does? Grab the markup from that component’s example page and paste that into your view.
2. **My design uses existing components, but has some special cases.**
_E.g. background colors, border, and font sizes_. Awesome, copy the component’s example markup to your view and add an atomic class to override its styling. Practically, this will likely just be adding something like a [`.mb12`](/system/base/spacing) to a button, or hiding something temporarily with [`.d-none`](/system/base/display).
3. **My design uses a new pattern that doesn’t have a component yet.**
No worries, let’s build your view by assembling some atomic classes. If you’re doing this more than once, you should help us identify a new pattern by [requesting a new component](https://github.com/StackExchange/Stacks/issues/new).
4. **My design is super special and…**
I’m going to write a lot of custom CSS from scratch in its own `.less` file that I’ve included in the bundle. You _probably_ shouldn’t be doing this. With atomic classes, you can build _most_ of what you’re attempting to do without writing a single new line of CSS. The Stacks team would prefer you use these pre-existing classes to build new UI. Every line of CSS you write, the more CSS we have to maintain, the more our users have to download, and the more bytes we have to host.
## Getting help[](#getting-help)
Need help? Open [an issue](https://github.com/StackExchange/Stacks/issues/new). We’ll be happy to help.
---
## Collection: forms
### Page: Checkbox
URL: https://stackoverflow.design/system/forms/checkbox
Date: 2026-08-13T14:42:34.530Z
description: Checkable inputs that visually allow for multiple options or true/false values.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-checkbox`
Base checkbox style.
N/A
N/A
`.s-checkbox__checkmark`
Checkmark style.
`.s-checkbox`
N/A
## Base[](#base)
Use the `.s-checkbox` to wrap `input[type="checkbox"]` elements to apply checkbox styles.
```html
```
Example
Description
Checkbox label
Unchecked checkbox.
Checkbox label
Disabled unchecked checkbox.
Checkbox label
Checked checkbox.
Checkbox label
Disabled checked checkbox.
### Checkmark[](#checkmark)
The checkmark style is an alternative to the base checkbox style. To use the checkmark style, wrap your input and label in a container with the `.s-checkbox__checkmark` class.
```html
```
Example
Class
Description
Checkmark label
`.s-checkbox__checkmark`
The checkmark, unchecked state.
Checkmark label
`.s-checkbox__checkmark`
Disabled, unchecked state.
Checkmark label
`.s-checkbox__checkmark`
The checkmark, checked state.
Checkmark label
`.s-checkbox__checkmark`
Disabled, checked state.
## Accessibility[](#accessibility)
The best accessibility is semantic HTML. Most screen readers understand how to parse inputs if they’re correctly formatted. When it comes to checkboxes, there are a few things to keep in mind:
* All inputs should have an `id` attribute.
* Be sure to associate the checkbox label by using the `for` attribute. The value here is the input’s `id`.
* If you have a group of related checkboxes, use the `fieldset` and `legend` to group them together.
For more information, please read Gov.UK’s article, [_“Using the fieldset and legend elements”_](https://accessibility.blog.gov.uk/2016/07/22/using-the-fieldset-and-legend-elements/).
## Checkbox group[](#checkbox-group)
### Vertical group[](#vertical-group)
```html
```
Which types of fruit do you like? (Check all that apply)
Apples
Oranges
Bananas
### Horizontal group[](#horizontal-group)
```html
```
Which types of fruit do you like? (Check all that apply)
Apples
Oranges
Bananas
### With description copy[](#with-description-copy)
```html
```
Which types of fruit do you like? (Check all that apply)
Apples
Fresh red apples.
Oranges
Juicy and sweet oranges.
Bananas
Ripe yellow bananas.
## Validation states[](#validation-states)
Checkboxes use the same validation states as [inputs](/system/components/inputs).
### Validation classes[](#validation-classes)
Class
Description
Applies to
`.has-warning`
Used to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.
Parent element
`.has-error`
Used to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.
Parent element
`.has-success`
Used to notify users that the value they've entered is fine or has been submitted successfully.
Parent element
### Validation examples[](#validation-examples)
```html
```
Which types of fruit do you like? (Check all that apply)
Apples
Fresh red apples.
Oranges
Juicy and sweet oranges.
Bananas
Ripe yellow bananas.
## Indeterminate state[](#indeterminate-state)
Checkboxes can be styled by using the `:indeterminate` pseudo class.
Information
**Note:** The `:indeterminate` pseudo class can only be set via JavaScript. Use the `HTMLInputElement` object's [`indeterminate`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes) property to set the state.
```html
```
Select all
---
### Page: Inputs
URL: https://stackoverflow.design/system/forms/inputs
Date: 2026-08-13T14:42:34.557Z
description: Input elements are used to gather information from users.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-input`
Base input style.
N/A
N/A
`.s-input__creditcard`
Adds a credit card icon to the input.
N/A
`.s-input`
`.s-input__search`
Adds a search icon to the input.
N/A
`.s-input`
`.s-input__sm`
Apply a small size.
N/A
`.s-input`
`.s-input__lg`
Apply a large size.
N/A
`.s-input`
## Base style[](#base-style)
Inputs are normally paired with a label, but there are times when they can be used without a label. Placeholder text should primarily be used as a content prompt and only provided when needed.
```html
This will be shown only to employers and other Team members.
```
Full name
This will be shown only to employers and other Team members.
Display name
Legal name
## Accessibility[](#accessibility)
The best accessibility is semantic HTML. Most screen readers understand how to parse inputs if they’re correctly formatted. When it comes to inputs, there are a few things to keep in mind:
* All inputs should have an `id` attribute.
* Be sure to associate the input’s label by using the `for` attribute. The value here is the input’s `id`.
* If you have a group of related inputs, use the `fieldset` and `legend` to group them together.
For more information, please read Gov.UK’s article, [_“Using the fieldset and legend elements”_](https://accessibility.blog.gov.uk/2016/07/22/using-the-fieldset-and-legend-elements/).
### Required input fields[](#required-input-fields)
Labels or instructions must be provided when content requires user input. For any input field within a form that is required for successful data submission, provide the asterisk `*` as a symbol and a legend advising the meaning of the symbol before the first use.
Stacks includes a special `.s-required-symbol` class to ensure the symbol (asterisk) is clearly visible.
Class
Description
Applies to
`.s-required-symbol`
Used to style the asterisk indicating that a specific field is required.
element enclosing the asterisk
```html
*
```
Required symbols are not necessary for areas where only a single input field is seen on the page (ex: sign up modals). For more information, see [WCAG Technique H90](https://www.w3.org/WAI/WCAG22/Techniques/html/H90).
### Required input fields example[](#required-input-fields-example)
```html
Ask a question
Required fields*
```
# Ask a question
Required fields\*
Title\*
Body\*
Ask team members
## Validation states[](#validation-states)
Validation states provides the user feedback based on their interaction (or lack of interaction) with an input. These styles are applied by applying the appropriate class to the wrapping parent container.
### Validation classes[](#validation-classes)
Class
Description
Applies to
`.has-warning`
Used to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.
Parent element
`.has-error`
Used to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.
Parent element
`.has-success`
Used to notify users that the value they've entered is fine or has been submitted successfully.
Parent element
### Validation guidance[](#validation-guidance)
In most cases, validation states shouldn’t be shown until after the user has submitted the form. There are certain exceptions where it can be appropriate to show a validation state without form submission—after a sufficient delay. For example, validating the existence of a username can occur after the user has stopped typing, or when they’ve deselected the input.
Once the user is presented validation states, they can be cleared as soon as the user interacts with the form field. For example, the error state for an incorrect password should be cleared as soon as the user focuses the input to re-enter their password.
Similarly to using `for` with labels, validation messages below inputs should be associated with their respective fields using the `aria-describedby` attribute for accessible behavior.
### Validation examples[](#validation-examples)
#### Warning[](#warning)
```html
```
Username
Caps lock is on! [Having trouble entering your username?](#)
#### Error[](#error)
Warning
In addition to using the "error" state for a field, be sure to use the [`aria-invalid`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-invalid_attributev) attribute to indicate to assistive technology that respective fields have failed validation.
```html
```
Username
That name is available! [Why do we require a username?](#)
## Icons[](#icons)
### Search[](#search)
Stacks provides helper classes to consistently style an input used for search. First, wrap your search input in an element with relative positioning. Then, and add `s-input__search` to the input itself. Finally, be sure to add `s-input-icon` and `s-input-icon__search` to the search icon.
```html
```
Credit Card
## Sizes[](#sizes)
Class
Name
Size
Example
`.s-input__sm`
Small
13px
N/A
Default
14px
`.s-input__lg`
Large
18px
## Input fills[](#input-fills)
Input fills are used to visually connect input text boxes with related content.
### Prepended inputs[](#prepended-inputs)
```html
```
Minimum Salary
Need Visa Sponsorship
## Nested inputs[](#nested-inputs)
An input can be nested within a container that has the `.s-input` class applied to display styled elements as if they’re within an input.
```html
svelte
```
Tags
svelte Dismiss svelte tag
---
### Page: Labels
URL: https://stackoverflow.design/system/forms/labels
Date: 2026-08-13T14:42:34.592Z
description: Labels are used to describe inputs, select menus, textareas, radio buttons, and checkboxes.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-label`
Base label style.
N/A
N/A
`.s-label__sm`
Apply a small size.
N/A
`.s-label`
`.s-label__lg`
Apply a large size.
N/A
`.s-label`
Labels inform users what information is being asked of them. They should be written in sentence case.
Information
For usability reasons, if a label is connected with an input, the `for="[id]"` attribute should be filled in. This attribute references the input's `id="[value]"` value. This makes clicking the label automatically focus the proper input.
## Base style[](#base-style)
```html
```
Question title
## Sizes[](#sizes)
Class
Name
Size
Example
`.s-label__sm`
Small
14px
Question title
N/A
Default
16px
Question title
`.s-label__lg`
Large
22px
Question title
## Description copy[](#description-copy)
When a label or input needs further explantation, text should be placed directly underneath it.
```html
```
Question title
Clear question titles are more likely to get answered.
## Status[](#status)
Use status indicators to append essential context to a label. This pattern supports any of the various badge states available. When using this indicator, display the full word ‘Required’ rather than an asterisk. Note: If the majority of a form’s inputs are required, prioritize the asterisk pattern outlined in [Input Accessibility](/system/components/inputs#accessibility) instead.
```html
```
Question titleRequired
```html
```
Question tagsOptional
```html
```
What is your favorite animal?Saved for later
```html
```
Notify peopleNew feature
---
### Page: Radio
URL: https://stackoverflow.design/system/forms/radio
Date: 2026-08-13T14:42:34.607Z
description: Checkable inputs that visually allow for single selection from multiple options.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-radio`
Base radio style.
N/A
N/A
`.s-radio__checkmark`
Checkmark style.
`.s-radio`
N/A
## Base[](#base)
Use the `.s-radio` to wrap `input[type="radio"]` elements to apply radio styles.
```html
```
Example
Description
Radio label
The base, unchecked state.
Radio label
Disabled, unchecked state.
Radio label
The checked state.
Radio label
Disabled, checked state.
### Checkmark[](#checkmark)
The checkmark style is an alternative to the base radio style. To use the checkmark style, wrap your input and label in a container with the `.s-radio__checkmark` class.
```html
```
Example
Class
Description
Checkmark label
`.s-radio__checkmark`
The checkmark, unchecked state.
Checkmark label
`.s-radio__checkmark`
Disabled, unchecked state.
Checkmark label
`.s-radio__checkmark`
The checkmark, checked state.
Checkmark label
`.s-radio__checkmark`
Disabled, checked state.
## Accessibility[](#accessibility)
The best accessibility is semantic HTML. Most screen readers understand how to parse inputs if they’re correctly formatted. When it comes to radios, there are a few things to keep in mind:
* All inputs should have an `id` attribute.
* Be sure to associate the radio label by using the `for` attribute. The value here is the input’s `id`.
* If you have a group of related radios, use the `fieldset` and `legend` to group them together.
For more information, please read Gov.UK’s article, [_“Using the fieldset and legend elements”_](https://accessibility.blog.gov.uk/2016/07/22/using-the-fieldset-and-legend-elements/).
## Radio group[](#radio-group)
### Vertical group[](#vertical-group)
```html
```
Which types of fruit do you like?
Apples
Oranges
Bananas
Pick a fruit
Apples
Oranges
Bananas
### Horizontal group[](#horizontal-group)
```html
```
Which types of fruit do you like?
Apples
Oranges
Bananas
### With description copy[](#with-description-copy)
```html
```
Which types of fruit do you like?
Apples
Fresh red apples.
Oranges
Juicy and sweet oranges.
Bananas
Ripe yellow bananas.
Pick a fruit
Apples
Fresh red apples.
Oranges
Juicy and sweet oranges.
Bananas
Ripe yellow bananas.
## Validation states[](#validation-states)
Radios use the same validation states as [inputs](/system/components/inputs).
### Validation classes[](#validation-classes)
Class
Description
Applies to
`.has-warning`
Used to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.
Parent element
`.has-error`
Used to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.
Parent element
`.has-success`
Used to notify users that the value they've entered is fine or has been submitted successfully.
Parent element
### Validation examples[](#validation-examples)
```html
```
Which types of fruit do you like?
Apples
Fresh red apples.
Oranges
Juicy and sweet oranges.
Bananas
Ripe yellow bananas.
Pick a fruit
Apples
Fresh red apples.
Oranges
Juicy and sweet oranges.
Bananas
Ripe yellow bananas.
---
### Page: Select
URL: https://stackoverflow.design/system/forms/select
Date: 2026-08-13T14:42:34.627Z
description: A selectable menu list from which a user can make a single selection. Typically they are used when there are more than four possible options. The custom select menu styling is achieved by wrapping the select tag within the .s-select class.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-select`
Base select style.
N/A
N/A
`.s-select__sm`
Apply a small size.
N/A
`.s-select`
`.s-select__lg`
Apply a large size.
N/A
`.s-select`
`.has-error`
Apply an error state.
N/A
`.s-select`
`.has-success`
Apply a success state.
N/A
`.s-select`
`.has-warning`
Apply a warning state.
N/A
`.s-select`
## Base style[](#base-style)
```html
```
How will you be traveling?
Select the transportation method you will be using to come to the event.
Please select one…WalkBicycleAutomobileTrainPlane
Where are you staying?
Please select one…BronxBrooklynManhattanQueensStaten Island
## Validation states[](#validation-states)
Validation states provides the user feedback based on their interaction (or lack of interaction) with a select menu. These styles are applied by applying the appropriate class to the wrapping parent container.
### Validation classes[](#validation-classes)
Class
Description
Applies to
`.has-warning`
Used to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.
Parent element
`.has-error`
Used to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.
Parent element
`.has-success`
Used to notify users that the value they've entered is fine or has been submitted successfully.
Parent element
### Validation examples[](#validation-examples)
#### Warning[](#warning)
```html
```
How will you be traveling?
Select the transportation method you will be using to come to the event.
Please select one…WalkBicycleAutomobileTrainPlane
#### Error[](#error)
```html
```
How will you be traveling?
Select the transportation method you will be using to come to the event.
Please select one…WalkBicycleAutomobileTrainPlane
#### Success[](#success)
```html
```
How will you be traveling?
Select the transportation method you will be using to come to the event.
Please select one…WalkBicycleAutomobileTrainPlane
## Sizes[](#sizes)
Class
Name
Size
Example
`.s-select__sm`
Small
13px
1 Example2 Options
N/A
Default
14px
1 Example2 Options
`.s-select__lg`
Large
18px
1 Example2 Options
---
### Page: Textarea
URL: https://stackoverflow.design/system/forms/textarea
Date: 2026-08-13T14:42:34.637Z
description: Multi-line inputs used by users to enter longer text portions.
Content:
## Classes[](#classes)
Class
Description
Parent
Modifies
`.s-textarea`
Base textarea style.
N/A
N/A
`.s-textarea__sm`
Apply a small size.
N/A
`.s-textarea`
`.s-textarea__lg`
Apply a large size.
N/A
`.s-textarea`
## Base style[](#base-style)
```html
```
Question body
## Accessibility[](#accessibility)
It is recommended to follow the same accessibility guidance as the [Input component](/system/components/inputs#accessibility). Including marking Textarea’s as **required** via the `.s-required-symbol` class.
## Validation states[](#validation-states)
Validation states provides the user feedback based on their interaction (or lack of interaction) with a textarea. These styles are applied by applying the appropriate class to the wrapping parent container.
### Validation classes[](#validation-classes)
Class
Description
Applies to
`.has-warning`
Used to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.
Parent element
`.has-error`
Used to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.
Parent element
`.has-success`
Used to notify users that the value they've entered is fine or has been submitted successfully.
Parent element
### Validation examples[](#validation-examples)
#### Warning[](#warning)
```html
Consider entering a description to help us better help you.
```
Description
Consider entering a description to help us better help you.
#### Error[](#error)
```html
A description must be provided.
```
Description
A description must be provided.
#### Success[](#success)
```html
Thanks for providing a description.
```
Description
How do you know your company is ready for a design system? How do you implement one without too many pain points? How do you efficiently maintain one once it's built?
Thanks for providing a description.
## Sizes[](#sizes)
Class
Name
Size
Example
`.s-textarea__sm`
Small
13px
N/A
Default
14px
`.s-textarea__lg`
Large
18px
---
## Collection: foundation
### Page: Color fundamentals
URL: https://stackoverflow.design/system/foundation/color-fundamentals
Date: 2026-08-13T14:42:34.652Z
description: Color is used distinguish our brand, convey meaning, and invoke emotions. A color palette ensures a familiar and consistent experience across our products.
Content:
## Palette[](#palette)
### Neutral colors[](#neutral-colors)
The neutral palette consists of black, white, and grays. The neutral palette is dominant in our UI, using subtle shifts in value to create hierarchy and organize content.
black-050
black-100
black-150
black-200
black-225
black-250
black-300
black-350
black-400
black-500
black-600
### Saturated colors[](#saturated-colors)
Stacks uses 5 colors with 6 stops per color. Colors are used sparingly and intentionally to convey meaning, draw attention to UI, or create associations.
orange-100
orange-200
orange-300
orange-400
orange-500
orange-600
blue-100
blue-200
blue-300
blue-400
blue-500
blue-600
green-100
green-200
green-300
green-400
green-500
green-600
red-100
red-200
red-300
red-400
red-500
red-600
yellow-100
yellow-200
yellow-300
yellow-400
yellow-500
yellow-600
purple-100
purple-200
purple-300
purple-400
purple-500
purple-600
pink-100
pink-200
pink-300
pink-400
pink-500
pink-600
orange-100
orange-200
orange-300
orange-400
orange-500
orange-600
blue-100
blue-200
blue-300
blue-400
blue-500
blue-600
green-100
green-200
green-300
green-400
green-500
green-600
red-100
red-200
red-300
red-400
red-500
red-600
yellow-100
yellow-200
yellow-300
yellow-400
yellow-500
yellow-600
purple-100
purple-200
purple-300
purple-400
purple-500
purple-600
pink-100
pink-200
pink-300
pink-400
pink-500
pink-600
## Usage[](#usage)
### Color roles[](#color-roles)
Color roles describe the intention behind the color.
Role
Description
black-400
Neutral
Use for text and secondary UI elements, such as buttons
theme-secondary
Primary
Use for primary actions
theme-primary
Accent
Use for UI that either relates to the brand or doesn't have a specific meaning tied to it.
blue-400
Information
Use for UI to communicate information that you'd like the user to be aware of
success
Success
Use for UI to communicate a successful action has taken place
warning
Warning
Use for UI that communicates a user should proceed with caution
danger
Danger
Use for UI that communicates the user has encountered danger or an error
purple-400
Discovery
Use for UI that depicts something new, such as onboarding or a new feature
### Backgrounds[](#backgrounds)
Default background color
black-050
50
black-100
100
black-150
150
black-200
200
black-225
black-250
black-300
black-350
black-400
black-500
black-600
Background layers
Stops 50 through 200 are used for background layers
### Borders[](#borders)
black-050
black-100
black-150
black-200
200
black-225
225
black-250
black-300
300
black-350
black-400
black-500
black-600
Decorative borders
Input borders
Stops 200 and 225 are used for decorative borders and dividers throughout our UI. The 250 stop is used for input borders such as text field or secondary button.
### Text[](#text)
black-050
black-100
black-150
black-200
black-225
black-250
black-300
black-350
black-400
400
black-500
500
black-600
600
Text
Heading
Stops 500 and 600 can be used for text. Neutrals, blue, red, and green can also be used at 400 and will meet APCA contrast minimums within these shades. Orange and yellow should not be used at 400 because it does not meet our contrast standards.
### Icons and illustrations[](#icons-and-illustrations)
black-050
black-100
black-150
black-200
black-225
black-250
black-300
black-350
350
black-400
400
black-500
500
black-600
Illustrations
Icons
Stops 400 and 500 are for icons, while 350 should be used for more detailed illustrations.
## Layering[](#layering)
Colors in the neutral palette are layered on top of each other to foster a sense of hierarchy and create associations.
Body background
Content
Component
Body background
Content
Component
Background layer
Light mode
Dark mode
Body background
black-100 black-100 (Teams)
black-050 black-100 (SO)
white white
Content
black-050 black-050
black-050 black-050
Component
black-100 black-100
black-100 black-100
Component alt
black-150 black-150
black-150 black-150
## Emphasis levels[](#emphasis-levels)
Emphasis determines the amount of contrast a color has against the default surface. Emphasis has a range from subtle to bold. Bold emphasis has more contrast against the background, which adds more attention than using UI with the subtle or default emphasis level.
Robots
Robots
Robots
Robots
Robots
Robots
Bold
Robots
Robots
Robots
Robots
Robots
Robots
Default
Robots
Robots
Robots
Robots
Robots
Robots
Subtle
Text
Bold
Text
Default
Text
Subtle
## Interaction states[](#interaction-states)
In Stacks, a component will get darker (or lighter in dark mode) as they interact with it. These progresses happen by adding 100 to the color before the interaction happens. Example: Blue-400 on hover becomes Blue-500. For a disabled button state, subtract 100 from the default color.
Button
Default
Button
Hover
Button
Selected
Button
Disabled
## Light, dark, and high contrast modes[](#light-dark-and-high-contrast-modes)
Stacks supports light, dark, and high contrast modes. By using Stacks, you will get each of these modes for free. By using a Stacks component, an atomic color class, or CSS variable directly, your theme will switch appropriately based on the following methods:
1. You can apply `.theme-system` to the `body` element. This will change colors based on the `prefers-color-scheme` media query, which is ultimately powered by the user's system or browser settings. This can be preferable for folks who have their system turn to dark mode based on ambient light or time of day.
2. Alternatively, you can set a dark mode that is not system dependent by attaching `.theme-dark` to the `body` element.
3. Adding `.theme-highcontrast` to the `body` element will boost colors to WCAG Level AAA contrast ratios in as many places as possible. This mode stacks on top of both light and dark modes. The only exception is branded themed colors remain untouched by high contrast mode.
There are also [conditional classes](/product/develop/conditional-classes#dark-mode) that can be applied to override assumed dark mode colors, force light mode, or to force dark mode. Forcing modes can be good for previews in admin-only situations.
---
### Page: Colors
URL: https://stackoverflow.design/system/foundation/colors
Date: 2026-08-13T14:42:34.670Z
description: To avoid specifying color values by hand, we've included a robust set of color variables. For maintainability, please use these instead of hardcoding color values.
Content:
## Stops[](#stops)
### Theme primary
theme-primary
theme-primary-100
theme-primary-200
theme-primary-300
theme-primary-400
theme-primary-500
theme-primary-600
### Theme secondary
theme-secondary
theme-secondary-100
theme-secondary-200
theme-secondary-300
theme-secondary-400
theme-secondary-500
theme-secondary-600
### Orange
orange-100
orange-200
orange-300
orange-400
orange-500
orange-600
### Blue
blue-100
blue-200
blue-300
blue-400
blue-500
blue-600
### Green
green-100
green-200
green-300
green-400
green-500
green-600
### Red
red-100
red-200
red-300
red-400
red-500
red-600
### Yellow
yellow-100
yellow-200
yellow-300
yellow-400
yellow-500
yellow-600
### Purple
purple-100
purple-200
purple-300
purple-400
purple-500
purple-600
### Pink
pink-100
pink-200
pink-300
pink-400
pink-500
pink-600
### Black
black-050
black-100
black-150
black-200
black-225
black-250
black-300
black-350
black-400
black-500
black-600
black
### White
white
## Brand[](#brand)
Warning
Please see [the brand guidelines for color use](https://stackoverflow.design/brand/color), these should not be used without prior direction from the brand team.
brand
brand-black
brand-off-white
brand-blue-light
brand-blue
brand-blue-dark
brand-brown-light
brand-green
brand-green-dark
brand-orange-medium
brand-orange-dark
brand-pink
brand-pink-dark
brand-purple
brand-purple-dark
brand-yellow
brand-yellow-dark
---
### Page: Theming
URL: https://stackoverflow.design/system/foundation/theming
Date: 2026-08-13T14:42:34.673Z
description: Stacks provides a robust theming API to handle theming in various contexts.
Content:
## Default theme stops[](#default-theme-stops)
Stacks provides primary and secondary theme stops that can be overridden in your custom theme.
## Theming API[](#theming-api)
### Programmatic theme generation[](#programmatic-theme-generation)
Use `.create-custom-theme-hsl-variables(@color, @tier, @modeCustom)` to create a custom theme.
This function generates two sets of CSS variables: 1) independent h/s/l color variables and 2) variables at each colors stop that reference the h/s/l variables. Provide this function the arguments defined below to generate theme colors which will apply across Stacks.
Argument
Type
Default
Description
`@color`
HSL, hex, or other color value
Color to use to generate theme values.
`@tier`
`primary` | `secondary`
`primary`
Color tier to generate.
`@modeCustom`
`base` | `dark`
`base`
The color mode the theme applies to.
#### Format[](#format)
```css
.theme-custom.themed {
.create-custom-theme-hsl-variables(hsl(172, 37%, 48%), primary);
.create-custom-theme-hsl-variables(hsl(259, 29%, 55%), secondary);
.create-custom-theme-hsl-variables(hsl(201, 70%, 55%), primary, dark);
.create-custom-theme-hsl-variables(hsl(270, 34%, 40%), secondary, dark);
}
```
#### Example[](#example)
```css
/* Input */
.theme-custom.themed {
.create-custom-theme-hsl-variables(hsl(172, 37%, 48%), primary);
}
/* Output */
.theme-custom.themed {
/* HSL variables */
--theme-base-primary-color-h: 172;
--theme-base-primary-color-s: 37%;
--theme-base-primary-color-l: 48%;
/* Color variables based on HSL variables */
--theme-primary-custom: var(--theme-primary-custom-400);
--theme-primary-custom-100: hsl(var(--theme-base-primary-color-h), calc(var(--theme-base-primary-color-s) + 0 * 1%), clamp(70%, calc(var(--theme-base-primary-color-l) + 50 * 1%), 95%));
--theme-primary-custom-200: hsl(var(--theme-base-primary-color-h), calc(var(--theme-base-primary-color-s) + 0 * 1%), clamp(55%, calc(var(--theme-base-primary-color-l) + 35 * 1%), 90%));
--theme-primary-custom-300: hsl(var(--theme-base-primary-color-h), calc(var(--theme-base-primary-color-s) + 0 * 1%), clamp(35%, calc(var(--theme-base-primary-color-l) + 15 * 1%), 75%));
--theme-primary-custom-400: hsl(var(--theme-base-primary-color-h), calc(var(--theme-base-primary-color-s) + 0 * 1%), clamp(20%, calc(var(--theme-base-primary-color-l) + 0 * 1%), 60%));
--theme-primary-custom-500: hsl(var(--theme-base-primary-color-h), calc(var(--theme-base-primary-color-s) + 0 * 1%), clamp(15%, calc(var(--theme-base-primary-color-l) + -14 * 1%), 45%));
--theme-primary-custom-600: hsl(var(--theme-base-primary-color-h), calc(var(--theme-base-primary-color-s) + 0 * 1%), clamp(5%, calc(var(--theme-base-primary-color-l) + -26 * 1%), 30%));
}
```
#### Manual addition of theme variables[](#manual-addition-of-theme-variables)
If you need to apply a theme without using the above function, you can do so by manually adding the variables above to your CSS. The most common use for this approach is when the theme needs to change client-side, such as when allowing the user to change and preview a theme dynamically.
With this approach, we recommend targeting new h/s/l color variables on a parent element that includes `.themed` class.
### Live playground[](#live-playground)
Information
An interactive theme playground is coming soon.
### Theme variables overrides[](#theme-variables-overrides)
Stacks provides CSS variables for fine grained control of theming. These variables allow you to adjust the theming on specific components and elements, as well as body background and font color.
```css
--theme-background-color
--theme-body-font-color
--theme-button-active-background-color
--theme-button-color
--theme-button-hover-background-color
--theme-button-hover-color
--theme-button-outlined-border-color
--theme-button-outlined-selected-border-color
--theme-button-primary-active-background-color
--theme-button-primary-background-color
--theme-button-primary-color
--theme-button-primary-hover-background-color
--theme-button-primary-hover-color
--theme-button-primary-number-color
--theme-button-primary-selected-background-color
--theme-button-primary-selected-color
--theme-button-selected-background-color
--theme-button-selected-color
--theme-link-color
--theme-link-color-hover
--theme-link-color-visited
--theme-post-body-font-family
--theme-post-title-color
--theme-post-title-color-hover
--theme-post-title-color-visited
--theme-post-title-font-family
--theme-tag-background-color
--theme-tag-border-color
--theme-tag-color
--theme-tag-hover-background-color
--theme-tag-hover-border-color
--theme-tag-hover-color
--theme-tag-required-background-color
--theme-tag-required-border-color
--theme-tag-required-color
--theme-tag-required-hover-background-color
--theme-tag-required-hover-border-color
--theme-tag-required-hover-color
--theme-topbar-height
```
## Child theming[](#child-theming)
Stacks allows for further theming various portions of a page. You can simply pair the `.themed` class with an atomic color stop, and a new theming scope. For this example, we’re using a class name of `.theme-team-[xxx]` with a unique ID appended.
```html
```
### Default[](#default)
body
Subscribe
1 2 Next
.themed.theme-team-001
C
Subscribe
1 2 Next
.themed.theme-team-002
C
Subscribe
1 2 Next
.themed.theme-team-003
C
Subscribe
1 2 Next
### Light forced[](#light-forced)
.theme-light\_\_forced body
Subscribe
1 2 Next
.theme-light\_\_forced .themed.theme-team-001
C
Subscribe
1 2 Next
.theme-light\_\_forced .themed.theme-team-002
C
Subscribe
1 2 Next
.theme-light\_\_forced .themed.theme-team-003
C
Subscribe
1 2 Next
### Dark forced[](#dark-forced)
.theme-dark\_\_forced body
Subscribe
1 2 Next
.theme-dark\_\_forced .themed.theme-team-001
C
Subscribe
1 2 Next
.theme-dark\_\_forced .themed.theme-team-002
C
Subscribe
1 2 Next
.theme-dark\_\_forced .themed.theme-team-003
C
Subscribe
1 2 Next
.theme-team-001 { --theme-base-primary-color-h: 349; --theme-base-primary-color-s: 81%; --theme-base-primary-color-l: 58%; --theme-base-secondary-color-h: 349; --theme-base-secondary-color-s: 81%; --theme-base-secondary-color-l: 58%; --theme-dark-primary-color-h: 349; --theme-dark-primary-color-s: 81%; --theme-dark-primary-color-l: 58%; --theme-dark-secondary-color-h: 349; --theme-dark-secondary-color-s: 81%; --theme-dark-secondary-color-l: 58%; } .theme-team-002 { --theme-base-primary-color-h: 41; --theme-base-primary-color-s: 93%; --theme-base-primary-color-l: 58%; --theme-base-secondary-color-h: 41; --theme-base-secondary-color-s: 93%; --theme-base-secondary-color-l: 58%; --theme-dark-primary-color-h: 41; --theme-dark-primary-color-s: 93%; --theme-dark-primary-color-l: 58%; --theme-dark-secondary-color-h: 41; --theme-dark-secondary-color-s: 93%; --theme-dark-secondary-color-l: 58%; } .theme-team-003 { --theme-base-primary-color-h: 288; --theme-base-primary-color-s: 76%; --theme-base-primary-color-l: 38%; --theme-base-secondary-color-h: 288; --theme-base-secondary-color-s: 76%; --theme-base-secondary-color-l: 38%; --theme-dark-primary-color-h: 288; --theme-dark-primary-color-s: 45%; --theme-dark-primary-color-l: 60%; --theme-dark-secondary-color-h: 288; --theme-dark-secondary-color-s: 45%; --theme-dark-secondary-color-l: 60%; }
---
### Page: Typography
URL: https://stackoverflow.design/system/foundation/typography
Date: 2026-08-13T14:42:34.728Z
description: Stacks provides atomic classes to override default styling of typography. Change typographic weights, styles, and alignment with these atomic styles.
Content:
## Basic[](#basic)
These styles should only be used as overrides. They shouldn’t replace standard semantic uses of `strong` or `em` tags.
### Basic classes[](#basic-classes)
Class
Output
Definition
`.fw-normal`
font-weight: 400;
Normal font weight. Maps to 400.
`.fw-medium`
font-weight: 500;
Medium font weight. Maps to 500.
`.fw-bold`
font-weight: 600;
Bold font weight. Maps to 600.
`.fs-normal`
font-style: normal;
Selects the normal font within the font-family.
`.fs-italic`
font-style: italic;
Selects the italic font within the font-family.
`.tt-capitalize`
text-transform: capitalize;
The first character in each word is capitalized regardless of markup.
`.tt-lowercase`
text-transform: lowercase;
All characters are lowercase regardless of markup.
`.tt-uppercase`
text-transform: uppercase;
All characters are uppercase regardless of markup.
`.tt-none`
text-transform: none;
Characters in a string remain unchanged.
`.tt-unset`
text-transform: unset;
Text-transform is unset entirely.
`.td-underline`
text-decoration: underline;
Text renders with an underline.
`.td-none`
text-decoration: none;
Text renders without an underline.
### Basic examples[](#basic-examples)
```html
…
…
…
…
…
…
…
…
…
…
……
```
**Font Weight:** Normal
**Font Weight:** Bold
**Font Style:** Normal
**Font Style:** Italic
**Font Style:** Unset
**Text Transform:** Capitalize
**Text Transform:** Lowercase
**Text Transform:** Uppercase
**Text Transform:** None
**Text Transform:** Unset
**Text Decoration:** Underline
**Text Decoration:** None
## Layout[](#layout)
### Layout classes[](#layout-classes)
Class
Output
Definition
Responsive?
`.ta-left`
text-align: left;
Inline contents are aligned to the left edge.
Yes
`.ta-center`
text-align: center;
Inline contents are aligned to the center.
Yes
`.ta-right`
text-align: right;
Inline contents are aligned to the right edge.
Yes
`.ta-justify`
text-align: justify;
Inline contents are justified. Text should be spaced to line up its left and right edges to the left and right edges, except for the last line.
`.ws-normal`
white-space: normal;
Lines are broken as necessary to fill the parent.
`.ws-nowrap`
white-space: nowrap;
Text wrapping is disabled.
`.ws-pre`
white-space: pre;
Whitespace is preserved but text won't wrap.
`.ws-pre-wrap`
white-space: pre-wrap;
Whitespace is preserved but text will wrap. New lines are preserved.
`.ws-pre-line`
white-space: pre-line;
Whitespace is preserved but text will wrap. New lines are collapsed.
`.ow-normal`
word-break: normal;
Restores overflow wrapping behavior.
`.ow-anywhere`
overflow-wrap: anywhere;
Breaks a string of characters at any point when no other acceptable break points are available and does not hyphenate the break.
`.ow-break-word`
overflow-wrap: break-word;
Breaks a word to a new line only if the entire word cannot be placed on its own line without overflowing.
`.ow-inherit`
overflow-wrap: inherit;
Inherits the parent value.
`.ow-intial`
overflow-wrap: intial;
Restores the value to the initial value set on the body.
`.ow-unset`
overflow-wrap: unset;
Unsets any inherited behavior. Does not work in IE.
`.break-word`
word-break: break-word; overflow-wrap: break-word; hyphens: auto;
A utility class combining all word-break strategies when you absolutely must break a word.
`.wb-normal`
word-break: normal;
Restores word break behavior.
`.wb-break-all`
word-break: break-all;
To prevent copy from overflowing its box, breaks should occur between any two characters (excluding Chinese, Japanese, and Korean text)
`.wb-keep-all`
word-break: keep-all;
Removes word breaks for Chinese, Japanese, and Korean text. All other text behavior is the same as normal.
`.wb-inherit`
word-break: inherit;
Inherits the parent value.
`.wb-intial`
word-break: intial;
Restores the value to the initial value set on the body.
`.wb-unset`
word-break: unset;
Unsets any inherited behavior.
Show All Classes
### Layout examples[](#layout-examples)
```html
Text align: Left
Text align: Center
Text align: Right
Justify: …
Text align: Unset
White-space: Normal
White-space: Nowrap
White-space: Pre
White-space: Pre-wrap
White-space: Pre-line
White-space: Unset
Break word
Truncate: …
```
**Text Align:** Left
**Text Align:** Center
**Text Align:** Right
**Text Align:** Justify — Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
**Text Align:** Unset
**White-space:** Normal
**White-space:** Nowrap
**White-space:** Pre
**White-space:** Pre-wrap
**White-space:** Pre-line
**White-space:** Unset
**Break word:** MethionylglutaminylarginylhionylglutaminylargintyrosylglutamylmethionylglutaminylarginyltyrlarginyltyrosylglutamylMethionylglutaminylarginyltyrosylglutamylnyltyrosylserinemethionylglutaminylargiglutamylmethionyosylglutamylmethionylglutaminylglutaminylarginyltyrosylglutamylmethionylglutaminylarginyltyrosylglutamylmetyltyrosylglutamylserine
## Fonts[](#fonts)
```html
…
…
…
…
```
Sans Serif
\-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"
Serif
Georgia, Cambria, "Times New Roman", Times, serif
Monospace
"SF Mono", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
## Sizes[](#sizes)
Fonts larger than `.fs-body1` are reduced in size at the smallest responsive breakpoint. `.fs-body1` or smaller remain fixed at their initial pixel values.
### Size classes[](#size-classes)
Class
Size
Line Height
Responsive Size
`.fs-fine`
`12px`
`1.36`
`12px`
`.fs-caption`
`13px`
`1.40`
`13px`
`.fs-body1`
`14px`
`1.40`
`14px`
`.fs-body2`
`16px`
`1.40`
`15px`
`.fs-body3`
`18px`
`1.40`
`16px`
`.fs-subheading`
`20px`
`1.40`
`18px`
`.fs-title`
`22px`
`1.40`
`20px`
`.fs-headline1`
`28px`
`1.40`
`23px`
`.fs-headline2`
`36px`
`1.40`
`26px`
`.fs-display1`
`46px`
`1.34`
`29px`
`.fs-display2`
`58px`
`1.28`
`34px`
`.fs-display3`
`72px`
`1.20`
`37px`
`.fs-display4`
`100px`
`1.18`
`43px`
### Size examples[](#size-examples)
```html
…
…
…
…
…
…
…
…
…
…
…
…
…
```
Fine
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Caption
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Body 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Body 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Body 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Subheading
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Headline 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Headline 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Display 1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Display 2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Display 3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Display 4
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
## Line height[](#line-height)
```html
…
…
…
…
…
…
…
```
**Line Height XS:** This sets the `line-height` value to `1`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
**Line Height SM:** This sets the `line-height` value to `1.15`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
**Line Height MD:** This sets the `line-height` value to `1.3`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
**Line Height LG:** This sets the `line-height` value to `1.6`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
**Line Height XL:** This sets the `line-height` value to `1.92`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
**Line Height XXL:** This sets the `line-height` value to `2`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
**Line Height Unset:** This sets the `line-height` value to `initial`. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
## Hyphenation[](#hyphenation)
Our hyphenation classes determine when text that wraps across multiple lines is hyphenated. You can prevent hyphenation entirely, or allow the browser to automatically hypenate.
```html
…
…
```
This text will not be hyphenated when large words break—longer words are broken by `.ow-break-word`.
This text will be hyphenated when large words break. `.ow-break-word` shouldn't be necessary since breaks are implied by hyphenation rules.
---