Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 5cab5bf

Browse files
committed
docs: add principles page
1 parent 3628bf9 commit 5cab5bf

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

docs/.vitepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function getSetupSidebar() {
4141
children: [
4242
{ text: 'Chakra UI Vue', link: '/' },
4343
{ text: 'Getting Started', link: '/pages/getting-started/getting-started' },
44-
{ text: 'Plugin Options', link: '/pages/getting-started/plugin-options' }
44+
{ text: 'Plugin Options', link: '/pages/getting-started/plugin-options' },
45+
{ text: 'Principles', link: '/pages/getting-started/principles' }
4546
]
4647
},
4748
{
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Design Principles
3+
description: Principles that keep Chakra's components fairly consistent
4+
---
5+
6+
Chakra UI is established on principles that keep its components fairly
7+
consistent. Understanding these concepts will help you better contribute to
8+
Chakra UI.
9+
10+
Our goal is to design simple, composable components that cater to real-life UI
11+
design problems. In order to do that, we developed a set of principles that help
12+
us always be on that path.
13+
14+
- **Style Props:** All component styles can be overridden or extended via style
15+
props to reduce the use of `css` prop or `styled()`. Compose new components from `Box`.
16+
17+
- **Simplicity:** Strive to keep the component API fairly simple and show real
18+
world scenarios of using the component.
19+
20+
- **Composition:** Break down components into smaller parts with minimal props
21+
to keep complexity low, and compose them together. This will ensure that the
22+
styles and functionality are flexible and extensible.
23+
24+
- **Accessibility:** When creating a component, keep accessibility top of mind.
25+
This includes keyboard navigation, focus management, color contrast, voice
26+
over, and the correct `aria-*` attributes.
27+
28+
- **Dark Mode:** Make components dark mode compatible. Use `useColorMode` hook
29+
to handle styling. [Learn more about dark mode](/docs/features/color-mode).
30+
31+
- **Naming Props:** We all know naming is the hardest thing in this industry.
32+
Generally, ensure a prop name is indicative of what it does. Boolean props
33+
should be named using auxiliary verbs such as `does`, `has`, `is` and
34+
`should`. For example, `Button` uses `isDisabled`, `isLoading`, etc.

0 commit comments

Comments
 (0)