Skip to content

Commit ea6f808

Browse files
committed
Update alignment docs
1 parent e85d211 commit ea6f808

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

guides/fields/alignment.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Alignment
22

3-
It is possible to align the fields of a resource in the index view and the labels of the fields in the edit view.
3+
It is possible to align the field values of a resource on index views and the labels of the fields on edit views.
44

5-
## Field Alignment (Index View)
5+
## Field Alignment (Index Views)
66

7-
You can align the fields of a resource in the index view by setting the `align` option in the field configuration.
7+
You can align the field values of a resource on index views by setting the `align` option in the field configuration.
88

99
The following alignments are supported: `:left`, `:center` and `:right`
1010

@@ -14,19 +14,19 @@ The following alignments are supported: `:left`, `:center` and `:right`
1414
@impl Backpex.LiveResource
1515
def fields do
1616
[
17-
%{
18-
...,
19-
align: :center
20-
}
17+
%{
18+
...,
19+
align: :center
20+
}
2121
]
2222
end
2323
```
2424

25-
The example above will align the field to the center in the index view.
25+
The example above will center the field value on the index view.
2626

27-
## Label Alignment (Edit View)
27+
## Label Alignment (Form Views)
2828

29-
You can align the labels of the fields in the edit view by setting the `label_align` option in the field configuration.
29+
You can align the labels of the fields on form views by setting the `label_align` option in the field configuration.
3030

3131
The following label orientations are supported: `:top`, `:center` and `:bottom`.
3232

@@ -35,12 +35,12 @@ The following label orientations are supported: `:top`, `:center` and `:bottom`.
3535
@impl Backpex.LiveResource
3636
def fields do
3737
[
38-
%{
39-
...,
40-
align_label: :top
41-
}
38+
%{
39+
...,
40+
align_label: :top
41+
}
4242
]
4343
end
4444
```
4545

46-
The example above will align the label to the top in the edit view.
46+
The example above will align the label to the top on the form view.

lib/backpex/field.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ defmodule Backpex.Field do
3434
type: :atom
3535
],
3636
align: [
37-
doc: "Align the fields of a resource in the index view.",
37+
doc: "Align the field value on index view.",
3838
type: {:in, [:left, :center, :right]}
3939
],
4040
align_label: [
41-
doc: "Align the labels of the fields in the edit view.",
41+
doc: "Align the label of the field on form views.",
4242
type: {:or, [{:in, [:top, :center, :bottom]}, {:fun, 1}]}
4343
],
4444
searchable: [

lib/backpex/fields/upload.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ defmodule Backpex.Fields.Upload do
379379
~H'<p><%= Backpex.HTML.pretty_value(@value) %></p>'
380380
end,
381381
except: [:index, :resource_action],
382-
align: :center
382+
align_label: :center
383383
},
384384
...
385385
]

0 commit comments

Comments
 (0)