Skip to main content
Urbicon UI

ApiReference

Structured API reference table — renders prop names, types, defaults, and descriptions with source and required badges.

01 Examples

Rendering a generated prop table

A page's API section

What the section looks like on every component page: the generated props, inside a Section with a secondary intent so reference content reads differently from guide content. types= and the TypesReference below it are one feature — the prop is what turns a type name in the Type column into a link, and the section is what the link points at.
3 props 1 required
Prop
Type
Default
Description
<script lang="ts">
  import { ApiReference, Section, TypesReference } from '@urbicon-ui/docs';
  import { componentData } from './api';
</script>

<Section marker id="api" title="API Reference" intent="secondary">
  <ApiReference props={componentData?.props ?? []} types={componentData?.types ?? []} />
</Section>

<TypesReference types={componentData?.types ?? []} />

Notes the generator cannot know

The usageNotes snippet renders above the table — for editorial guidance that belongs to the API as a whole rather than to any single prop.
<ApiReference props={componentData.props} slotClasses={{ stats: 'hidden' }}>
  {#snippet usageNotes()}
    <p>Sizes below <code>md</code> are reserved for dense toolbars.</p>
  {/snippet}
</ApiReference>

02 Accessibility

It is a table, and it says so

The props render through @urbicon-ui/table, so the browser exposes real rows and columns: a screen reader announces "row 4 of 26, column Type" instead of reading a wall of divs. Sorting a column updates aria-sort on its header.

Badges are not the only signal

Required props and their source are marked with a badge and with text in the badge, never with colour alone — the required marker reads "required", not a red dot.

Type cross-links

A type that resolves to a local definition renders as a link into the Types section on the same page. It is an ordinary in-page anchor, so it works with the keyboard and appears in the link list a screen reader can bring up.

03 API Reference

8 props 1 required
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

4 types
Name
Kind
Category
Used by
Description

05 Installation

Import

import { ApiReference } from '@urbicon-ui/docs';