Introduction
Theme Raed uses a flexible component system that allows you to customize your store’s homepage with various pre-built components. Each component is configurable through thetwilight.json file and can be customized with fields like titles, images, links, and products.
Component structure
Components in Theme Raed are located insrc/views/components/ and organized by section:
- Header components: Store header with navigation and search
- Footer components: Store footer with links and contact information
- Home components: Homepage sections like sliders, product grids, and testimonials
Using components
Components are included in Twig templates using the{% component %} tag:
Component configuration
Each component is configured intwilight.json under the components array. Configuration includes:
Unique identifier for the component
Component title in multiple languages (ar, en)
Salla icon class for the component
Component template path (e.g.,
home.enhanced-slider)Array of configurable fields for the component
Available field types
Components support various field types for customization:- string: Text input, textarea, or image URL
- boolean: Switch/toggle field
- items: Dropdown list or multi-select
- collection: Repeatable group of fields
- static: Descriptive text or images (non-editable)
- number: Numeric input with min/max validation
Component variables
All components receive these standard variables:Contains merchant settings from twilight.json fields
Sorting number starting from zero, used for unique IDs
Theme settings
Global theme settings are configured in thesettings array of twilight.json and accessed via:
header_is_sticky: Sticky header on scrollfooter_is_dark: Dark footer modetopnav_is_dark: Dark top navigationis_more_button_enabled: Show “View All” buttons
Next steps
Layout components
Explore header, footer, and master layout
Home components
Learn about homepage components