--- layout : 'default' css : 'guide' title : 'Authoring UI' type : 'UI Specification' --- <%- @partial('header') %>

Creating an Element

Semantic defines five categories of elements, each type of element has different definition requirements

Creating Components ===================================== The first step after deciding what type of element you are creating is writing a spec file, these allow you to define the language for describing your interface element before beginning to write a component. The spec file can be used to generate a css and javascript stub which will give you a starting point for writing your component. Spec files content varies depending on which of the five UI types are being defined. Here's an example spec file for a ui element button. You can read more about creating spec files After creating a spec file you can use semantic to generate ui components. Simply specify a package name and json spec file. semantic generate awesome button.json This will create a stub css (and possibly js) file in ui/element with your definition. This will also create a stub html file in docs/, this is the visual representation of your element definition, and will appear unformatted until you begin to create your css. As you edit each css definition to create the look and feel of your element, you can refresh this page to verify each element appears properly. After you finish writing your UI component, if you would like to register your package to be used by others. No need to package anything up, simply type semantic register awesome button Assuming your package name is not taken, your buttons will now be available on semantic.