Expand description
§Ferro JSON-UI
JSON-based server-driven UI schema types for the Ferro framework.
This crate defines the v2 Spec foundation: a flat, ID-keyed element map
with parse-time structural validation. Typed *Props structs describe
per-component prop shape and feed the Phase 117 catalog via JsonSchema.
§Schema Structure
A JSON-UI Spec consists of:
- Spec - Top-level container:
$schema,root,elements,title?,layout?,data? - Element - Single UI node:
type(string),props(Value),children(Vec<String>of IDs),action?,visible? - Actions - Handler references with confirmations and outcomes
- Visibility - Conditional rendering based on data conditions
§Example
use ferro_json_ui::{Spec, Element};
let spec = Spec::builder()
.title("Demo")
.element("root", Element::new("Text").prop("content", "Hi"))
.build()
.unwrap();Re-exports§
pub use action::Action;pub use action::ActionOutcome;pub use action::ConfirmDialog;pub use action::DialogVariant;pub use action::HttpMethod;pub use action::NotifyVariant;pub use assets::FERRO_BASE_CSS;pub use component::ActionCardProps;pub use component::ActionCardVariant;pub use component::AlertProps;pub use component::AlertVariant;pub use component::AvatarProps;pub use component::BadgeProps;pub use component::BadgeVariant;pub use component::BreadcrumbItem;pub use component::BreadcrumbProps;pub use component::ButtonGroupProps;pub use component::ButtonProps;pub use component::ButtonType;pub use component::ButtonVariant;pub use component::CardProps;pub use component::CardVariant;pub use component::CheckboxListProps;pub use component::CheckboxProps;pub use component::ChecklistItem;pub use component::ChecklistProps;pub use component::CollapsibleProps;pub use component::Column;pub use component::ColumnFormat;pub use component::DataTableProps;pub use component::DescriptionItem;pub use component::DescriptionListProps;pub use component::DropdownMenuAction;pub use component::DropdownMenuProps;pub use component::EmptyStateProps;pub use component::FormMaxWidth;pub use component::FormProps;pub use component::FormSectionProps;pub use component::GapSize;pub use component::GridProps;pub use component::HeaderProps;pub use component::IconPosition;pub use component::ImageProps;pub use component::InputProps;pub use component::InputType;pub use component::KanbanBoardProps;pub use component::KanbanColumnProps;pub use component::ModalProps;pub use component::NotificationDropdownProps;pub use component::NotificationItem;pub use component::Orientation;pub use component::PageHeaderProps;pub use component::PaginationProps;pub use component::ProductTileProps;pub use component::ProgressProps;pub use component::RawHtmlProps;pub use component::RichTextEditorProps;pub use component::SelectOption;pub use component::SelectProps;pub use component::SeparatorProps;pub use component::SidebarGroup;pub use component::SidebarProps;pub use component::Size;pub use component::SkeletonProps;pub use component::SortDirection;pub use component::StatCardProps;pub use component::SwitchProps;pub use component::Tab;pub use component::TableProps;pub use component::TabsProps;pub use component::TextElement;pub use component::TextProps;pub use component::ToastProps;pub use component::ToastVariant;pub use config::JsonUiConfig;pub use runtime::FERRO_RUNTIME_JS;pub use layout::register_layout;pub use layout::render_layout;pub use layout::DashboardLayout;pub use layout::DashboardLayoutConfig;pub use layout::Layout;pub use layout::LayoutContext;pub use layout::LayoutRegistry;pub use layout::SidebarSection;pub use catalog::global_catalog;pub use catalog::Catalog;pub use catalog::CatalogError;pub use catalog::ComponentSpec;pub use expression::resolve_expressions;pub use loader::load_cached;pub use loader::LoadError;pub use plugin::collect_plugin_assets;pub use plugin::global_plugin_registry;pub use plugin::register_plugin;pub use plugin::registered_plugin_types;pub use plugin::with_plugin;pub use plugin::Asset;pub use plugin::CollectedAssets;pub use plugin::JsonUiPlugin;pub use plugin::PluginRegistry;pub use plugins::register_built_in_plugins;pub use plugins::MapPlugin;pub use plugins::RichTextEditorPlugin;pub use render::render_spec_to_html;pub use render::render_spec_to_html_with_plugins;pub use render::RenderResult;pub use resolve::expand_directives;pub use resolve::resolve_actions;pub use resolve::resolve_actions_strict;pub use resolve::resolve_errors;pub use resolve::resolve_errors_all;pub use spec::DataRef;pub use spec::Element;pub use spec::ElementBuilder;pub use spec::Spec;pub use spec::SpecBuilder;pub use spec::SpecError;pub use spec::TitleBinding;pub use spec::MAX_NESTING_DEPTH;pub use spec::SCHEMA_VERSION;pub use visibility::Visibility;pub use visibility::VisibilityCondition;pub use visibility::VisibilityOperator;
Modules§
- action
- Action declarations for JSON-UI components.
- assets
- Embedded static assets for ferro-json-ui.
- catalog
- Component Catalog
- component
- Component catalog for JSON-UI.
- config
- Configuration for JSON-UI rendering.
- data
- Data path resolution for JSON-UI.
- expression
- Server-side expression resolver for v2 JSON-UI Specs.
- layout
- Layout system for JSON-UI page rendering.
- loader
- Page Loader
- plugin
- Plugin system for JSON-UI custom interactive components.
- plugins
- Built-in plugin components for JSON-UI.
- render
- Renders a
Specto HTML. - resolve
- Resolvers for v2 JSON-UI Spec element maps.
- runtime
- Built-in JavaScript runtime for ferro-json-ui (split per concern).
- spec
- v2 Spec types: flat element map with ID-keyed references.
- visibility
- Conditional visibility rules for JSON-UI components.