Installing
Semantic uses an eponymous package manager written in node. To begin you must install nodejs and npm for your platform.
After these dependencies are ready to go, you can install semantic using npm
Usage
Components are given a namespace. This makes sure the css rules dont interfere with other rules on your page.
If multiple components are available of the same type, you can specify which one to use by adding the package's name before. A package name is different than its namespace, for example there may be many types of buttons.
Components will download inside a directory. To use these components, simply link to their javascript and css in a web page
So I downloaded a component, now what?
Semantic components are self documenting, that means documentation are generated automatically after you download. You can see the element and code samples by simply opening up the corresponding html file.
You can view an example of an element definition by checking out the docs for semantic's first party button definition
View button definitionWhy Use Semantic?
Semantic sees website development as the coallescence of two things: Re-usable UI Components + Discardable Page Glue
Semantic is a framework for writing portable UI components, which helps you and others re-use and re-skin your ui elements in their projects.
Definitions and Language
Natural language is particularly good at describing visual scenes, i.e. dogs, trees, flowers and hard at defining abstractions: behavior, emotions, etc. Where programming languages are particularly good at describing behavior, but can be more obtuse at describing layouts.
Semantic adopts concepts from natural languages like: plurals, adjectives, and tense so web developers can enjoy some of the more useful features of natural language. Semantic also aspires for developers to make decision based on common usage instead of deciding arbitrarily how to name things.
For example if a developer wants to include a set of red buttons with icons on a page he can simple grab the semantic button and icon component:
Authoring
Creating a component in semantic requires two steps:
- Defining how your element can look.
- Writing code to match your definitions
These steps can be completed in either order. If you enjoy Test-Driven-Development, you can write your specification before coding, or if you prefer a more ad-hoc approach you can swap the order, defining your element only after you finish describing it.
Consuming
Semantic is a package manager, created by other people is a simple process
- Search semantic for a type of UI component
- Open up its specification to see what it can do and how to use it.