new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Storybook · API · all subjects

argtypes/doc-block

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

ArgTypes block import

The ArgTypes block is imported from '@storybook/addon-docs/blocks' using: import { ArgTypes } from '@storybook/addon-docs/blocks';

ArgTypes block purpose

The ArgTypes block displays a static table of arg types for a given component as a way to document its interface. For a dynamic table showing a story's current arg values that supports user changes, use the Controls block instead.

ArgTypes block include prop

The include prop on ArgTypes accepts type string[] | RegExp with default value parameters.docs.argTypes.include. It specifies which arg types to include in the args table. Any arg types whose names don't match the regex or are not part of the array will be left out.

ArgTypes block of prop

The of prop on ArgTypes accepts type Story export or CSF file exports. It specifies which story to get the arg types from. If a CSF file exports is provided, it will use the primary (first) story in the file.

ArgTypes block sort prop

The sort prop on ArgTypes accepts type 'none' | 'alpha' | 'requiredFirst' with default value parameters.docs.argTypes.sort or 'none'. It specifies how the arg types are sorted. 'none' displays unsorted in the same order arg types are processed; 'alpha' sorts alphabetically by arg type name; 'requiredFirst' sorts like alpha with required arg types displayed first.

ArgTypes block configuration with props and parameters

The ArgTypes block is configured with props in MDX. Many props derive their default value from a corresponding parameter in the block's namespace, parameters.docs.argTypes. Parameters can be applied at component (meta) level, project level, or story level.

ArgTypes block MDX example

Example MDX usage of ArgTypes block: ```mdx import { Meta, ArgTypes } from '@storybook/addon-docs/blocks'; import * as ButtonStories from './Button.stories'; <Meta of={ButtonStories} /> <ArgTypes of={ButtonStories} /> ```

ArgTypes block exclude example

Example of excluding specific arg types from the ArgTypes block: ```mdx <ArgTypes of={ButtonStories} exclude={['style']} /> ```

Give your agent this brain