home
  • Blog
1.11
  • Getting Started
  • Concepts
  • The Object Model
  • Application
  • Templates
  • Routing
  • Components
  • Controllers
  • Models
  • Views
    • Introduction
    • Defining a View
    • Handling Events
    • Inserting Views in Templates
    • Adding Layouts to Views
    • Customizing a View's Element
    • Built-in Views
    • Manually Managing View Hierarchy
  • Enumerables
  • Testing
  • Configuring Ember.js
  • Cookbook
  • Understanding Ember.js
  • Contributing to Ember.js
Old Guides - You are viewing the guides for Ember v1.11.0.
Go to v5.0.0

Built-in Views

Edit pencil

Ember comes pre-packaged with a set of views for building basic controls like text inputs, check boxes, and select lists. Usually, these views will be used via the input helpers. However, the base views may be helpful in creating custom form behaviors.

  • Ember.Checkbox
  • Ember.TextField
  • Ember.TextArea

For example, here we have created a custom text field that toggles a dirty property:

app/templates/some-template-using-a-view.hbs
{{view "my-input" value=name inputDidChange=nameDidChange}}
app/views/my-input.js
export default Ember.TextField.extend({
  inputDidChange: false,
  change: function() {
    this.set('inputDidChange', true);
  }
});

Ember itself provides one additional view not covered by the input helpers, and this is the select box view.

  • Ember.Select

This class can also be customized by extending it. To use the select view bundled with Ember, call it via the view helper:

{{view "select" content=people
                optionLabelPath="content.fullName"
                optionValuePath="content.id"
                prompt="Pick a person:"
                selection=selectedPerson}}

The select view is extremely feature-rich, and may perform badly when rendering many items. Due to this, it has not yet been converted into an component or helper like other inputs.

left arrow
Customizing a View's Element
Manually Managing View Hierarchy
right arrow
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2023 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue