A container component with ASCII borders for organizing and grouping related content.
Welcome to React ASCII UI! This is a card component with a title.
This card doesn't have a title prop, so you can add your own header.
npm install react-ascii-ui
import { AsciiCard, AsciiButton } from 'react-ascii-ui';
export default function Example() {
return (
<AsciiCard title="User Profile">
<p>Welcome back, User!</p>
<AsciiButton>Edit Profile</AsciiButton>
</AsciiCard>
);
}This is a basic card without a title.
<AsciiCard> <p>This is a basic card without a title.</p> </AsciiCard>
All systems operational.
<AsciiCard title="[ SYSTEM STATUS ]"> <p>All systems operational.</p> </AsciiCard>
<AsciiCard title="Login">
<div style={{ display: 'flex', flexDirection: 'column', gap: '15px' }}>
<AsciiInput placeholder="Username" />
<AsciiInput type="password" placeholder="Password" />
<AsciiButton>Sign In</AsciiButton>
</div>
</AsciiCard><div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gap: '20px' }}>
<AsciiCard title="CPU">
<div style={{ color: '#00ff00', fontSize: '24px' }}>45%</div>
<div style={{ color: '#ccc', fontSize: '12px' }}>Usage</div>
</AsciiCard>
<AsciiCard title="RAM">
<div style={{ color: '#ffaa00', fontSize: '24px' }}>78%</div>
<div style={{ color: '#ccc', fontSize: '12px' }}>Usage</div>
</AsciiCard>
<AsciiCard title="DISK">
<div style={{ color: '#ff4444', fontSize: '24px' }}>92%</div>
<div style={{ color: '#ccc', fontSize: '12px' }}>Usage</div>
</AsciiCard>
</div>| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | - | Optional title displayed at the top of the card |
| children | React.ReactNode | - | The content of the card |
| className | string | - | Additional CSS classes |
| style | React.CSSProperties | - | Inline styles |
AsciiCard extends all HTML div attributes and React.HTMLAttributes<HTMLDivElement>.