Perspective views are the building blocks of user interfaces in Ignition projects. Proper organization and styling ensure usability, scalability, and maintainability.
-
View Naming Conventions
- Use
PascalCase
orTitle Case
for view names (e.g.,MainView
orMain View
).
- Use
-
Property Naming
- Use
camelCase
starting with a lowercase letter for property names.params.publicProperty
for external-facing properties.custom.privateProperty
for internal properties.
- Use
-
Component Naming
- Use
PascalCase
for component names to maintain consistency (e.g.,ButtonSubmit
).
- Use
-
Page Names
- Use lowercase with hyphens for multi-word page names (e.g.,
main-page
).
- Use lowercase with hyphens for multi-word page names (e.g.,
-
Style Classes
- Use
lowercase
with hyphens for style class names (e.g.,header-bar
). - Organize style classes into folders matching the view hierarchy.
- Use
-
Support Themes
- Set colors to use Ignition's built-in theme variables for consistency and easy theming.
-
Keep Views Modular
- Break down complex views into smaller, reusable embedded views.
-
Event Handling
- Use message handlers and custom methods for centralized event logic. Avoid embedding complex logic directly in component event scripts.
-
Responsive Design
- Use Flex Containers to achieve responsiveness.
- Leverage breakpoints and percentage-based sizing for mobile-friendly designs.
-
Parameter Usage
- Use view parameters (
params
) for passing data between embedded views. - Avoid hardcoding references to ensure reusability.
- Use view parameters (
-
Performance Considerations
- Minimize bindings to reduce computation overhead.
- Use expression bindings for lightweight calculations.
- Cache results when dealing with high-latency data sources.
-
Dashboards
- Use Flex Containers with evenly spaced child views for dynamic dashboards.
-
Data Entry Forms
- Utilize binding for validation and scripts for on-submit logic.
-
Charts and Graphs
- Use Ignition's built-in charting components or integrate third-party charting libraries.
Feel free to contribute additional tips or corrections by submitting a pull request!