Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
semantic-ui-ember
Advanced tools
This is the official Ember library for the Semantic-UI modules. The code was original built for CrowdOx and other projects that we were building for clients. We would appreciate any feedback that you have.
We feel that the Semantic-UI-Ember project should be an extension of Semantic-UI and not a complete rewrite. With that in mind, we will always be a very lightweight layer on top to make the integration a first-class Ember experience. Please follow the official documentation for futher information.
Include the library as an NPM dependency, from within an ember-cli app.
ember install semantic-ui-ember
If using ember-cli 0.1.5 – 0.2.3
ember install:addon semantic-ui-ember
If using ember-cli < 0.1.5
npm install --save-dev Semantic-Org/Semantic-UI-Ember
Run the library's blueprint to pull in its Bower dependencies. This only needs to be done once.
ember generate semantic-ui-ember
ui accordion
ui-accordion
Replace <div class="ui accordion">
with {{#ui-accordion}}
and fill the inside content with standard Semantic-UI.
{{#ui-accordion}}
<div class="title">
Semantic UI
</div>
<div class="content">
Accordion Component
</div>
{{/ui-accordion}}
Variations can be used with {{#ui-accordion class="styled"}}
.
{{#ui-accordion class="styled"}}
<div class="active title">
<i class="dropdown icon"></i>
What is a dog?
</div>
<div class="active content">
<p>A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.</p>
</div>
<div class="title">
<i class="dropdown icon"></i>
What kinds of dogs are there?
</div>
<div class="content">
<p>There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.</p>
</div>
<div class="title">
<i class="dropdown icon"></i>
How do you acquire a dog?
</div>
<div class="content">
<p>Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.</p>
<p>A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.</p>
</div>
{{/ui-accordion}}
ui checkbox
ui-checkbox
Replace <div class="ui checkbox">
with {{ui-checkbox}}
and bind to a property on your model/controller/component.
export default Ember.Controller.extend({
havingFun: false
});
{{ui-checkbox checked=havingFun}}
ui radio
ui-radio
Replace <div class="ui radio">
with {{ui-radio}}
and bind to a property on your model/controller/component.
export default Ember.Controller.extend({
fruit: null
});
<div class="ui form">
<div class="grouped inline fields">
<div class="field">
{{ui-radio name="fruit" label="Once a week" value="apple" current=fruit}}
</div>
<div class="field">
{{ui-radio name="fruit" label="2-3 times a week" value="orange" current=fruit}}
</div>
<div class="field">
{{ui-radio name="fruit" label="Once a day" value="grape" current=fruit}}
</div>
</div>
</div>
There isn't a corresponding Ember component for this since it isn't rendered to the screen but instead invoked.
ui dropdown
ui-dropdown
optionValuePath
Replace <div class="ui dropdown">
with {{ui-dropdown}}
and fill in your content
export default Ember.Controller.extend({
itemActions: [ "Edit", "Remove", "Hide"],
selectedAction: null,
actions: {
update_selected: function(component, id, value) {
this.set('selectedAction', id);
}
}
});
{{#ui-dropdown class="selection" onChange=(action 'update_selected')}}
<div class="default text">Select an item</div>
<i class="dropdown icon"></i>
<div class="menu">
{{#each itemActions as |action|}}
<div class="item" data-id="{{action}}">
{{action}}
</div>
{{/each}}
</div>
{{/ui-dropdown}}
ui embed
{{ui-embed
data-source="youtube"
data-id="pfdu_gTry8E"}}
ui modal
ui-modal
Embed the Modal within your page's template, similar to the semantic-ui master documentation.
Except instead of using <div class='ui modal'>
you can use {{ui-modal}}
. Each
modal MUST include a name so it knows which one you are referring too.
{{#ui-modal name="profile" class="profile" approve=(action 'approveModal') deny=(action 'denyModal')}}
<i class="close icon"></i>
<div class="header">
Profile Picture
</div>
<div class="image content">
<div class="ui medium image">
<img src="http://semantic-ui.com/images/avatar/large/chris.jpg">
</div>
<div class="description">
<div class="ui header">We've auto-chosen a profile image for you.</div>
<p>We've grabbed the following image from the <a href="https://www.gravatar.com" target="_blank">gravatar</a> image associated with your registered e-mail address.</p>
<p>Is it okay to use this photo?</p>
</div>
</div>
<div class="actions">
<div class="ui black deny button">
Nope
</div>
<div class="ui positive right labeled icon button">
Yep, that's me
<i class="checkmark icon"></i>
</div>
</div>
{{/ui-modal}}
In order to open the modal you just need to execute the show command.
export default Ember.Controller.extend({
actions: {
openModal: function(name) {
$('.ui.modal').modal('show');
}
}
});
ui nag
{{#ui-nag}}
<span class="title">
We use cookies to ensure you get the best experience on our website
</span>
<i class="close icon"></i>
{{/ui-nag}}
ui popup
ui-popup
Replace <div class="ui popup">
with {{ui-popup}}
and fill the inside content with standard Semantic-UI.
{{#ui-popup content="The text you'd like to show"}}
<div class="ui button">BUTTON</div>
{{/ui-popup}}
You can also create an icon version by specifying the tagName
{{ui-popup tagName="i" class="icon info" content="The text you'd like to show"}}
ui progress
{{#ui-progress percent=40 classNames="teal indicating"}}
<div class="bar"></div>
<div class="label">Completed</div>
{{/ui-progress}}
ui rating
{{ui-rating initialRating=3 maxRating=7}}
ui search
{{#ui-search url="/search"}}
<input class="prompt" type="text" placeholder="Common passwords...">
<div class="results"></div>
{{/ui-search}}
ui shape
{{#ui-shape}}
<p>Content</p>
{{/ui-shape}}
You control the shape through semantic's regular javascript code
import Ember from 'ember';
export default Ember.Controller.extend(Ember.Evented, {
actions: {
flip: function(direction) {
$('.ui.shape').shape('flip ' + direction);
}
}
});
ui sidebar
The sidebar, as per Semantic-UI's documentation, will need to be directly below the body element. Since Ember by default renders a container element you need to utilize a little trick to get rid of it.
export default Ember.Component.extend({
tagName: ''
});
{{#ui-sidebar class="inverted vertical menu"}}
<a class="item">
1
</a>
<a class="item">
2
</a>
<a class="item">
3
</a>
{{/ui-sidebar}}
<div class="ui grid pusher">
</div>
When you want to invoke the sidebar you simply use the semantic methods.
import Ember from 'ember';
export default Ember.Controller.extend(Ember.Evented, {
actions: {
toggle: function(direction) {
$('.ui.sidebar').sidebar('toggle');
}
}
});
Not implemented. Better suited to use routes through Ember. If you disagree please open an issue with how you would see it used.
ui transition
You can invoke the semantic javascript directly.
import Ember from 'ember';
export default Ember.Controller.extend(Ember.Evented, {
actions: {
transition: function() {
$('img').transition('horizontal flip', '500ms');
}
}
});
FAQs
The Official Semantic UI Addon for Ember applications
The npm package semantic-ui-ember receives a total of 1,118 weekly downloads. As such, semantic-ui-ember popularity was classified as popular.
We found that semantic-ui-ember demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.