 		.childAlignment(.Center)
 		// Layout children in a column.
 		.direction(.Column)
+		.flex(1)
 		.children([
 			Label("You've clicked \(count) times!"),
 			Button(title: "Click me!", action: updateCounter)


func renderCounter(component: Component<Int>, count: Int) -> Element {
	let updateCounter = { component.updateState { $0 + 1 } }
	
	return Element()
		// The view itself should be centered.
		.justification(.Center)

	}
	return TableView([elements], headers: [Label("Hello Header!")], footers: [Label("Hello Footer!")], selectionChanged: println)
		.flex(1)
}

let TableViewDemo = { Component(initialState: (), render: renderTableView) }

func renderInput(component: Component<String>, state: String) -> Element {
	return Element()
		.justification(.Center)
		.childAlignment(.Center)
		.flex(1)
		.children([
			View(backgroundColor: UIColor.greenColor())
				.direction(.Column)
				.children([
					View(backgroundColor: UIColor.blueColor(), borderColor: UIColor.blackColor(), borderWidth: 2, cornerRadius: 5)
						.margin(Edges(uniform: 10))
						.size(100, 100),
					Input(placeholder: "Username")
						.margin(Edges(uniform: 10)),
					Input(placeholder: "Password", secure: true)
						.margin(Edges(uniform: 10))
				])
		])
}
let InputDemo = { Component(initialState: "", render: renderInput) }

