Doist / reactist

Open source React components made with ❤️ by Doist
http://doist.github.io/reactist
MIT License
247 stars 21 forks source link

BREAKING: Button components change #830

Closed gnapse closed 1 month ago

gnapse commented 1 month ago

Short description

BeforeAfter
- `Button` always render semantic buttons, and has an API that allows it to render both as - a button with a visual text label and optional icon - or an icon-only button - `ButtonLink` - a mirror of `Button`, but that is meant to render links that visually look like buttons - it has all the same capabilities to render with or without a visible text label - `Button` renders always a button-like element with a visible text label - it offers ways to render semantically as a link, while keeping its visuals intact - it is not able to render an icon-only button - `IconButton` - it offers ways to render semantically as a link, while keeping its visuals intact - it is not able to render a button with a visual label, only with an icon (label is kept semantically and shown as a tooltip)
```jsx // Visually labelled button // Visually labelled link // (that looks like a button) Open // Icon-only button ```jsx // Visually labelled button // Visually labelled link // (that looks like a button) // Icon-only button } /> // Link that looks like // an icon-only button } render={} /> ```

PR Checklist

Versioning