Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,42 @@ Notice:

---

## Creating Custom Components

When creating custom components in your project, extend `IComponentProps` and pass the styling props to your root element:

```tsx
import { IComponentProps, Stack, Text } from '@kibalabs/ui-react';
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import for Direction enum. The code example uses Direction.Vertical but doesn't import it. Should add Direction to the import statement:

import { IComponentProps, Stack, Text, Direction } from '@kibalabs/ui-react';
Suggested change
import { IComponentProps, Stack, Text } from '@kibalabs/ui-react';
import { IComponentProps, Stack, Text, Direction } from '@kibalabs/ui-react';

Copilot uses AI. Check for mistakes.

interface IMyComponentProps extends IComponentProps {
title: string;
onClicked?: () => void;
}

export const MyComponent = (props: IMyComponentProps): React.ReactElement => {
return (
<Stack
id={props.id}
className={props.className}
style={props.style}
direction={Direction.Vertical}
>
<Text>{props.title}</Text>
</Stack>
);
};
```

`IComponentProps` provides:
- `id?: string` - HTML id attribute
- `className?: string` - Additional CSS classes
- `style?: React.CSSProperties` - Inline styles
- `variant?: string` - Component variant (if applicable)

**Always pass `id`, `className`, and `style` to your root element** to ensure consumers can style and identify your component.

---

## Development

### Prerequisites
Expand Down
Loading
Loading