Modal

Ejemplo de modal básico


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModal">Abrir modal básico</button>

<div class="modal fade" id="basicExampleModal" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-secondary">Guardar</button>
</div>
</div>
</div>
</div>

Modal centrado


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalCentered">Abrir modal centrado</button>

<div class="modal fade" id="basicExampleModalCentered" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalCenteredLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalCenteredLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancelar</button>
<button type="button" class="btn btn-secondary">Guardar</button>
</div>
</div>
</div>
</div>

Usando el Grid


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalGrid">Abrir modal usango el grid</button>

<div class="modal fade" id="basicExampleModalGrid" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalGridLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalGridLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-3 ml-auto">.col-md-3 .ml-auto</div>
<div class="col-md-2 ml-auto">.col-md-2 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-6 ml-auto">.col-md-6 .ml-auto</div>
</div>
<div class="row">
<div class="col-sm-9">
Level 1: .col-sm-9
<div class="row">
<div class="col-8 col-sm-6">
Level 2: .col-8 .col-sm-6
</div>
<div class="col-4 col-sm-6">
Level 2: .col-4 .col-sm-6
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-secondary">Guardar</button>
</div>
</div>
</div>
</div>

Pequeño


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalSmall">Abrir modal pequeño</button>

<div class="modal fade" id="basicExampleModalSmall" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalSmallLabel" aria-hidden="true">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalSmallLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-secondary">Guardar</button>
</div>
</div>
</div>
</div>

Grande


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalLarge">Abrir modal grande</button>

<div class="modal fade" id="basicExampleModalLarge" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalLargeLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalLargeLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-danger">Borrar</button>
</div>
</div>
</div>
</div>

Extra grande


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalExtraLarge">Abrir modal extra grande</button>

<div class="modal fade" id="basicExampleModalExtraLarge" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalExtraLargeLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalExtraLargeLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cerrar</button>
<button type="button" class="btn btn-secondary">Guardar</button>
</div>
</div>
</div>
</div>

Full width


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalFullwidth">Abrir modal full width</button>

<div class="modal fade" id="basicExampleModalFullwidth" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalFullwidthLabel" aria-hidden="true">
<div class="modal-dialog modal-full-width" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalFullwidthLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>
</div>

Video


<button type="button" class="btn btn-secondary mb-1" data-toggle="modal" data-target="#basicExampleModalVideo">Abrir modal video</button>

<div class="modal fade" id="basicExampleModalVideo" tabindex="-1" role="dialog" aria-labelledby="basicExampleModalVideoLabel" aria-hidden="true">
<div class="modal-dialog modal-video" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="row">
<div class="col">
<h4 class="modal-title" id="basicExampleModalVideoLabel">Título del modal</h4>
</div>
<div class="col-auto">
<button type="button" class="close btn btn-secondary btn-icon btn-sm" data-dismiss="modal" aria-label="Close"><span class="icon-close"></span></button>
</div>
</div>
</div>
<div class="modal-body">
<div class="youtube-video-wrap">
<iframe width="560" height="315" src="https://www.youtube.com/embed/NYl97rTsevQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
</div>
</div>
</div>