Edit in JSFiddle

ko.components.register('message-editor', {
    viewModel: function(params) {
        this.text = ko.observable(params === undefined ? '' : params.initialText);
    },
    template: 'Message: <input data-bind="value: text" /> '
            + '(length: <span data-bind="text: text().length"></span>)'
});
 
ko.applyBindings();
<h4>First instance, without parameters</h4>
<div data-bind='component: "message-editor"'></div>
 
<h4>Second instance, passing parameters</h4>
<div data-bind='component: {
    name: "message-editor",
    params: { initialText: "Hello, world!" }
}'></div>

              

External resources loaded into this fiddle: