2.1.1 • Published 8 months ago
@ode-react-ui/components v2.1.1
Open Digital Education React Components
Getting Started
We follow WAI ARIA rules and Bootstrap 5 guidelines when making our components
Build
yarn build
Lint
yarn lint
If yarn lint
shows issues, run this command to fix them.
yarn fix
Prettier
yarn format
Structure
Component Folder
- Folder name always in PascalCase:
Button
- Component file in PascalCase:
Button.tsx
- Export types & interfaces inside Component file
- Stories file in PascalCase +
*.stories.tsx
:Button.stories.tsx
src
-- ComponentFolder
-- Component.tsx
-- Component.stories.tsx
-- index.ts
- Re-export the Component inside his own
index
file:index.ts
- Export everything if Component has types & interfaces
export { default as Component } from "./Component";
export * from "./Component";
Component Guideline
- Always document basic guideline of Component with JSDoc format. Used by Storybook to generate documentation.
/**
* Primary UI component for user interaction
*/
Interface description
- Always document typescript types and interface with JSDoc syntax. Used by Storybook to generate documentation.
// Interface description (e.g: TreeViewProps.tsx)
export interface ButtonProps {
/**
* Is this the principal call to action on the page?
*/
primary?: boolean;
/**
* What background color to use
*/
backgroundColor?: string;
/**
* How large should the button be?
*/
size?: "small" | "medium" | "large";
/**
* Button contents
*/
label: string;
/**
* Optional click handler
*/
onClick?: () => void;
}
Index file inside src
folder
- Entry point of this React Library.
- Import your component inside
index.ts
file.
export * from "./Button";
Dev
You can build your component using Storybook
. See README
2.1.1-dev.5
10 months ago
2.1.1-dev.4
10 months ago
2.1.1-dev.3
10 months ago
2.1.1-dev.2
10 months ago
2.1.1-dev.1
10 months ago
2.1.1-dev.0
11 months ago
2.1.1-dev.6
10 months ago
2.1.1
10 months ago
2.1.2-dev.0
10 months ago
2.1.2-dev.1
10 months ago
2.1.2-dev.2
10 months ago
2.1.2-dev.3
10 months ago
2.1.2-dev.4
10 months ago
2.1.2-dev.5
10 months ago
2.1.2-dev.6
10 months ago
2.1.2-dev.7
8 months ago
2.1.0-dev.15
11 months ago
2.1.0-dev.14
11 months ago
2.1.0-dev.13
11 months ago
2.1.0
11 months ago
2.1.0-dev.12
11 months ago
2.1.0-dev.11
11 months ago
2.1.0-dev.10
11 months ago
2.1.0-dev.9
11 months ago
2.1.0-dev.8
11 months ago
2.1.0-dev.7
11 months ago
2.1.0-dev.6
11 months ago
2.1.0-dev.5
11 months ago
2.1.0-dev.4
11 months ago
2.1.0-dev.3
12 months ago
2.1.0-dev.2
12 months ago
2.0.1-dev.1
12 months ago
2.0.1-dev.0
12 months ago
2.0.0
12 months ago
2.0.0-dev.12
12 months ago
2.0.0-dev.11
12 months ago
2.0.0-dev.0
12 months ago