Skip to content

Backend independence

Frasto is a UI library. The consuming application owns how data is loaded, authorized, mutated, cached, and persisted.

---
import { Status, Table } from '@freightpx/frasto';
---
<Table caption="Customers">
<thead>
<tr><th scope="col">Customer</th><th scope="col">Status</th></tr>
</thead>
<tbody>
{customers.map((customer) => (
<tr>
<th scope="row">{customer.name}</th>
<td><Status tone={customer.tone}>{customer.status}</Status></td>
</tr>
))}
</tbody>
</Table>

The page or endpoint loads customers; Table only owns semantic presentation. Avoid a component API that owns transport:

<CustomerTable endpoint="/api/customers" />

The same component contract should work with Astro Actions, REST, GraphQL, Supabase, Appwrite, Firebase, a server database query, or a custom external API.

  • display-oriented TypeScript contracts
  • events for interaction intent
  • presentation contracts for loading, empty, error, and partial states
  • form markup and accessible feedback structure
  • database schema or ORM entities
  • authentication provider
  • authorization policy
  • API client
  • request caching
  • optimistic update strategy
  • server error taxonomy

Integration examples belong in guides and recipes, not as core component requirements.