-
-
Notifications
You must be signed in to change notification settings - Fork 263
Description
🚧 Status: Draft 🚧
The following items are needed in order to enable progressive enhancement capabilities for prerendered or server-rendered components:
General: documentation
Add a special section for progressive enhancement, and provide badges for every component that contains explicit support for it. We may also want a checklist system for all components; that way it's clear which components does or does not support certain functionality.
General: Form actions and href
See #1599
-
components with an inner button should provide a
formAttributesprop that is of type{ formAction: fn } | HTMLAttributes<form>Example:
<FluidForm formAttributes={{ action: "?/addItem", formAction: enhance }} />
Underlying component has:
<script> export let formAttributes: HTMLAttributes<form> $: ({ formAction, ...formAttrs } = formAttributes) </script> <form {...formAttrs} use:formAction />
-
components with inner buttons that can change data or state may receive an
hrefprop, allowing users to choose a new page or the same page withsearchParams, impacting the displayed information
UIShell
WIP
- use media queries for responsive styles
Accordion
WIP
Breakpoint
- discourage use for progressive enhancement
- Consider providing utility classes or components for responsive show/hide logic
<Button>
-
<Button>can leverage the nativeformactionattribute to set its individual formaction path - SvelteKit's
use:enhanceonly applies to<form>elements (see demo for enhanced button formaction); so we would have to either wrap<Button>or advise users to provide their own<form>since<Button>is a primitive single-element component - ButtonSet can have its vertical or horizontal style set with CSS media queries
Modal
WIP
DataTable
WIP
Combobox
WIP
Dropdown
WIP
Tabs
WIP
Toggle
WIP
Tooltip, Tooltip Icon, Tooltip Definition
WIP
Theme
WIP
UIShell
- Menu items currently toggle on click. It may be possible to leverage
:hasand:activein order to keep sub-menus open after clicking on them without JS. Otherwise, we'll consider these 'enhanced with JS' and providehrefprops to the top-most links, and encourage users to provide index pages for top-level links
### Related Tasks
- [ ] #310
- [ ] https://github.com/carbon-design-system/carbon-components-svelte/issues/1006
- [ ] https://github.com/carbon-design-system/carbon-components-svelte/issues/1006