@abateman/components-bolt-button 中文文档教程
按钮是传达号召性用语的品牌组件。 为 Bolt 设计系统 提供支持的 Bolt“组件”CSS 框架的一部分。
Install via NPM
npm install @abateman/components-bolt-button
Description
按钮是我们动作组件的核心。 它们的可见性是即时的,可用于大多数操作,并允许用户通过一次交互访问目标。 按钮清楚地为用户提供了下一步。
我们的按钮取决于它们所包含的主题,并根据所述主题改变外观。 主题和按钮颜色是一起设计的,以确保适当的数量和清晰度。
Xlight and light themes
- Primary: Light Indigo container with white text
- Secondary: white button with indigo text
- Text button: Light indigo text with chevron
Dark and xdark themes
主要:带有默认靛蓝文本的黄色容器
次要:带有靛蓝文本的白色按钮
文本按钮:带有 V 形的白色文本
目前只有一个定义的大小(尽管其他选项可以并且将来会定义)
可以是包装纸的 100% 宽度移动或卡片实例
可以选择 100% 宽度。 例如,按钮在大屏幕上的默认宽度为 2 rem,但在小屏幕上为全宽
Dos
- CTAs must be clearly and succinctly labeled with a next step
- CTA should lead with strong action verbs
- The primary CTA should be the most important action.
- Be consistent in placement based on the screen size and device
- Fall back to the text button in secondary and tertiary content areas where you can. For example, cards with a button use the text style so that a filled button doesn't become overwhelming and redundant.
- Follow theming rules
Don'ts
- Don't clutter the page with too many buttons
- Don't mix and match themes and their button colors. For example, do not use the indigo button on dark and xdark themes as the indigo button does not stand out enough.
- Don't mix and match colors outside the theme, see button groups.
Button is a branded component to convey call to action. Part of the Bolt “Components” CSS framework that powers the Bolt Design System.
Install via NPM
npm install @abateman/components-bolt-button
Description
Buttons are the core of our action components. Their affordance is immediate and can be use for most actions and allow users to access the target with a single interaction. Buttons clearly provide a next step for the user.
Our Buttons depend on the theme they are contained in and change in appearance based on said theme. The themes and button colors were designed together to ensure the proper amount affordance and clarity.
Xlight and light themes
- Primary: Light Indigo container with white text
- Secondary: white button with indigo text
- Text button: Light indigo text with chevron
Dark and xdark themes
Primary: Yellow container with default indigo text
Secondary: white button with indigo text
Text button: white text with chevron
Currently only have one defined size (though other options can and will be defined in the future)
Can be 100% width of the wrapper for mobile or card instances
Can optionally be 100% width. For example, the button has default width of 2 rem on either side on larger screens but full width on smaller screens
Dos
- CTAs must be clearly and succinctly labeled with a next step
- CTA should lead with strong action verbs
- The primary CTA should be the most important action.
- Be consistent in placement based on the screen size and device
- Fall back to the text button in secondary and tertiary content areas where you can. For example, cards with a button use the text style so that a filled button doesn't become overwhelming and redundant.
- Follow theming rules
Don'ts
- Don't clutter the page with too many buttons
- Don't mix and match themes and their button colors. For example, do not use the indigo button on dark and xdark themes as the indigo button does not stand out enough.
- Don't mix and match colors outside the theme, see button groups.