Overview
Mantlz SDK provides flexible theming capabilities that allow you to create fully custom themes or modify existing ones. You can customize every aspect of your forms using theappearance prop.
Theme Structure
A theme in Mantlz SDK is structured with three main sections:Form
Container, title, and description styling
Field
Input fields, labels, and error messages
Button
Submit button styling and states
Theme Type Definition
Here’s the complete TypeScript interface for creating a custom theme:Using the Appearance Prop
Theappearance prop allows you to customize forms without creating a full theme:
Appearance Interface
- Variables
- Elements
- Base Theme
Creating a Complete Custom Theme
Here’s a step-by-step example of creating a full custom theme:Real-World Examples
- Gradient Theme
- Minimal Theme
- Neumorphism Theme
Pseudo-State Styling
You can style different states of inputs and buttons:Order Form Button Styling
For order forms, you can apply special styling:Best Practices
Theme Design Guidelines
Consistency
- Use consistent spacing scale (4px, 8px, 12px, 16px)
- Maintain uniform border radius throughout
- Apply consistent color palette
- Ensure sufficient color contrast (WCAG AA minimum)
- Provide clear focus states for inputs
- Use readable font sizes (min 13px for body text)
- Use CSS transitions for smooth interactions
- Avoid complex backdrop filters on mobile
- Optimize shadow usage
- Set max-width for optimal readability
- Use relative units (em, rem) for scalability
- Test on various screen sizes
CSS Variables
Mantlz SDK uses Radix UI color variables. You can reference these in your themes:Tips and Tricks
Combining Themes with Tailwind CSS
Combining Themes with Tailwind CSS
You can use Tailwind utility classes in the
elements prop:Creating Theme Presets
Creating Theme Presets
Create reusable appearance configurations:Use them in your components:
lib/theme-presets.ts
Responsive Styling
Responsive Styling
Use responsive Tailwind classes:
Related Resources
Built-in Themes
Explore the pre-built themes
Props Reference
Complete props documentation