Skip to content
","upvoteCount":0,"url":"https://github.com/storybookjs/storybook/discussions/31943#discussioncomment-13651664"}}}

How the heck does sb-unstyled work? #31943

Answered by dosubot bot
Kegulf asked this question in General
Jul 3, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @Kegulf! I'm Dosu and I’m helping the storybook team.

The sb-unstyled class in Storybook is used as an "escape hatch" to prevent Storybook's default docs styles from affecting certain content. The Unstyled block is a React component that simply renders a

with the sb-unstyled class. When you wrap content in this block, Storybook's global CSS selectors are written to specifically exclude any element with sb-unstyled (and its descendants) from the default styling—so your content inside stays untouched by Storybook's docs CSS. There are no direct CSS rules for sb-unstyled itself; its power comes from being excluded in the selectors that apply the default styles (docs, code, selector stra…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Kegulf
Comment options

Answer selected by Kegulf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant