Skip to content

Docs: Document <Button> Props #25

@ericdellacasa8

Description

@ericdellacasa8

Context

The README lists the available Elements components, but individual component props are not yet documented in detail.

<Button> is one of the most commonly used components, so it is a good first component to document clearly.

Definition of Done

Add documentation for the <Button> component props.

The documentation should:

  • Include a props table for <Button>
  • Cover common props such as text, children, href, backgroundColor, color, fontSize, fontFamily, padding, borderRadius, and textAlign
  • Document nested escape hatches such as buttonColors and border
  • Note that fontFamily must be { label, value }, not a string
  • Note that fontWeight must be a number
  • Include default values where available
  • Be added to packages/react/README.md, Storybook autodocs, or another appropriate docs location

Example Outcome

A developer evaluating or using Elements should be able to quickly understand which props <Button> accepts and how to use them correctly.

For example, the documentation should make it clear that:

<Button
  href="https://example.com"
  backgroundColor="#000000"
  color="#ffffff"
  borderRadius="8px"
>
  Get started
</Button>

is valid usage, while also documenting the more advanced prop shapes where needed.

Where to Start

Useful references already exist in the codebase:

  • packages/react/src/components/Button.tsx
  • Button.stories.tsx
  • packages/shared/src/utils/semantic-props.ts

The goal is to turn the existing component props and examples into clear public documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions