Skip to main content

Annotations

@CStory

Marks a composable function as a story, demonstrating a component in the catalog.

ParameterTypeRequiredDescription
collectionStringyesRoot level of the catalog navigation.
groupStringyesLogical grouping of stories under a collection. Can be hierarchical.
nameStringyesStory label displayed in the navigation. Must not contain /.
tagsArray<String>noOptional tags for the story.
componentStringnoSafe FQN reference to a @CStoryComponent, usually via CStoryComponentRefs.
themeWrapperKClass<*>noAn object implementing CStoriesThemeWrapper used only for this story.

Applies to: top-level @Composable functions. Any::class means that the catalog-level wrapper is used.

@CStoryComponent

Marks a design-system function as a documentable component, making it available through the generated CStoryComponentRefs object so a @CStory can safely reference it, and surfacing its KDoc in the catalog's documentation panel.

ParameterTypeRequiredDescription
namespaceStringnoOptional Kotlin-identifier namespace used to nest the generated reference under CStoryComponentRefs.<namespace>.... Leave it blank to preserve the historical root-level reference.

Applies to: top-level functions, or object/companion object member functions.

See also: Reference a component in a story and Customize the catalog theme.