# Dynamically Create UI Elements

**URL:** <https://discourse.julialang.org/t/dynamically-create-ui-elements/60459>\
**Category:** Pluto\
**Created:** [May 3, 2021, 12:11pm UTC](https://discourse.julialang.org/t/dynamically-create-ui-elements/60459 "2021-05-03T12:11:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MLackner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mlackner/32/2789_2.png) [@MLackner](https://discourse.julialang.org/u/MLackner)\
**Post date:** [May 3, 2021, 12:11pm UTC](https://discourse.julialang.org/t/dynamically-create-ui-elements/60459/1 "2021-05-03T12:11:27Z")

</div>

Hi!

I wonder if there’s a way to dynamically create UI elements like sliders.

This would be helpful in the following use case: Assume you want to plot a polynomial and you want to let the user decide which degree N it should have.

y(x) = \sum\_n^N a\_n x^n

The idea now would be that you have a slider that would let you choose a value for N. This should then generate N sliders that would let you choose values for the parameter a\_n.

I tried to do this with

```julia
a = zeros(N)
for i in 1:N
	@bind a[i] Slider(-1:0.1:1)
end

```

however, that throws an error.

I wonder if someone has a solution for this?
