|
| 1 | +# API Reference |
| 2 | + |
| 3 | +Complete reference for all Dashkit components and functions. |
| 4 | + |
| 5 | +## Core Components |
| 6 | + |
| 7 | +### Layout Components |
| 8 | +- **[create_layout](components/layout.md)** - Main application layout with sidebar and header |
| 9 | +- **[create_sidebar](components/sidebar.md)** - Configurable sidebar navigation |
| 10 | +- **[create_header](components/header.md)** - Two-tier header with actions and search |
| 11 | + |
| 12 | +### UI Components |
| 13 | +- **[Table](components/table.md)** - Modern data tables with Handsontable integration |
| 14 | +- **[Buttons](components/buttons.md)** - Primary and secondary button components |
| 15 | +- **[Cards](components/cards.md)** - Card containers for content organization |
| 16 | +- **[MarkdownReport](components/markdown.md)** - Markdown content rendering |
| 17 | + |
| 18 | +### Chart Components (Optional) |
| 19 | +- **[AreaChart](components/charts.md#areachart)** - Area chart visualization |
| 20 | +- **[BarChart](components/charts.md#barchart)** - Bar chart visualization |
| 21 | +- **[ChartContainer](components/charts.md#chartcontainer)** - Chart wrapper component |
| 22 | + |
| 23 | +## Setup & Configuration |
| 24 | + |
| 25 | +### Application Setup |
| 26 | +- **[setup_app](setup.md#setup_app)** - Configure Dash app with Dashkit styling |
| 27 | + |
| 28 | +### Theme Management |
| 29 | +- **[ThemeManager](theming.md)** - Theme switching and persistence |
| 30 | + |
| 31 | +## Installation Options |
| 32 | + |
| 33 | +```bash |
| 34 | +# Core components only |
| 35 | +pip install dash-dashkit |
| 36 | + |
| 37 | +# With table support |
| 38 | +pip install dash-dashkit[table] |
| 39 | + |
| 40 | +# With chart support |
| 41 | +pip install dash-dashkit[charts] |
| 42 | + |
| 43 | +# With contribution graphs |
| 44 | +pip install dash-dashkit[kiboui] |
| 45 | + |
| 46 | +# Everything included |
| 47 | +pip install dash-dashkit[all] |
| 48 | +``` |
| 49 | + |
| 50 | +## Import Structure |
| 51 | + |
| 52 | +```python |
| 53 | +# Core imports |
| 54 | +from dashkit import create_layout, setup_app |
| 55 | +from dashkit import Table, PrimaryButton, SecondaryButton |
| 56 | +from dashkit import Card, MetricCard, ChartCard, MarkdownReport |
| 57 | + |
| 58 | +# Optional chart imports (requires dashkit_shadcn) |
| 59 | +from dashkit import AreaChart, BarChart, ChartContainer |
| 60 | + |
| 61 | +# Direct component imports |
| 62 | +from dashkit_table import DashkitTable |
| 63 | +from dashkit_kiboui import ContributionGraph |
| 64 | +from dashkit_shadcn import AreaChart as ShadcnAreaChart |
| 65 | +``` |
| 66 | + |
| 67 | +## Quick Example |
| 68 | + |
| 69 | +```python |
| 70 | +from dash import Dash, html |
| 71 | +import dashkit |
| 72 | + |
| 73 | +app = Dash(__name__) |
| 74 | +dashkit.setup_app(app) |
| 75 | + |
| 76 | +data = [{"name": "Alice", "score": 10}, {"name": "Bob", "score": 20}] |
| 77 | +columns = [{"data": "name", "title": "Name"}, {"data": "score", "title": "Score"}] |
| 78 | + |
| 79 | +app.layout = dashkit.create_layout( |
| 80 | + content=html.Div([ |
| 81 | + html.H3("Dashboard"), |
| 82 | + dashkit.Table(id="table", data=data, columns=columns, height=300), |
| 83 | + dashkit.PrimaryButton("Add Row", icon="plus") |
| 84 | + ]), |
| 85 | + sidebar_config={"brand_name": "My App"}, |
| 86 | + header_config={"page_title": "Dashboard"} |
| 87 | +) |
| 88 | + |
| 89 | +if __name__ == "__main__": |
| 90 | + app.run(debug=True) |
| 91 | +``` |
0 commit comments